본문 바로가기

Deep Learning Tools

(펌) Tensorflow로 word2vec 구현하기 http://excelsior-cjh.tistory.com/156http://solarisailab.com/archives/374
Nengo로 one-hot-vector에 반응하는 one-hot-neuron 만들기 Deep learning에서는 대부분 one-hot-vector로 학습을 수행하는데, 이를 neuron으로 표현하기는 까다로울 수 있다.그래서 one-hot-vector에 반응하는 one-hot-neuron을 만들어보쟈! 우선 간단한 one-hot-vector를 return하는 함수를 만들어보자 1234567891011121314151617import numpy as npimport matplotlib.pyplot as plt%matplotlib inline import nengofrom nengo.dists import Choicefrom nengo.utils.ensemble import tuning_curvesfrom nengo.utils.matplotlib import rasterplot def i..
Nengo synapse에 PES learning 적용 예제 Nengo에서는 PES learning (https://banana-media-lab.tistory.com/26) 을 synapse에 넣어 학습을 적용할 수 있다. 1234567891011121314151617import numpy as npimport matplotlib.pyplot as plt%matplotlib inline import nengofrom nengo.processes import WhiteSignal model = nengo.Network()with model: inp = nengo.Node(WhiteSignal(50, high=5), size_out=1) pre = nengo.Ensemble(50, dimensions=1) nengo.Connection(inp, pre) post =..
Prescribed Error Sensitivity (PES) learning rule Spiking neural network에서 back-propagation이나 supervised learning을 통해 학습을 하는 것은 설계하기가 매우 까다롭다.이를 해소하기 위해 Prescribed Error Sensitivity (PES) 라는 learning rule이 제시되었다.PES learning rule은 external error signal을 최소화 하기 위해 neuron population의 connection weight를 조절한다.여기서 x neuron은 presynaptic neuron, y neuron은 postsynaptic neuron으로 보자. y neuron의 목적은 y*의 활성을 모사하는 것이다.x와 y 사이의 synaptic weight는 |y* - y|의 활성인 ..
Bienenstock, Cooper, and Munro (BCM) learning rule Nengo에서는 대표적으로 BCM과 Oja learning rule이 사용된다. BCM learning rule은 associative Hebbian learning rule의 일종이다.BCM learnung rule은 1981년 visual cortex에서 발견된 synaptic plasticity를 바탕으로 만들어진 이론인데, postsynaptic neuron의 활성에 따라 LTP와 LTD가 야기된다.Presynaptic neuron이 발화한 후, postsynaptic neuron이 lower-activity state로 발화하면 LTD가 발생하고, high-activity state가 되면 LTP가 발생한다.즉, presynaptic neuron이 발화하지 않으면, postsynaptic neu..
Nengo 음성 데이터를 neural network에 입력으로 넣기 음성 데이터를 이용해 neuron의 활성을 조절해보자! 먼저 librosa를 이용해 음성파일을 load해보았다. 123456789101112131415161718import librosaimport librosa.displayimport IPython.displayimport numpy as npimport matplotlib.pyplot as pltimport matplotlib as mplimport matplotlib.font_manager as fm import tensorflow as tf %matplotlib inline audio_path = '4_3273.wav' y, sr = librosa.load(audio_path) plt.figure()plt.plot(y)cs 123456time_d..
Nengo neuron에 특정한 값 input으로 넣기 1234567891011import nengoimport numpy as np with nengo.Network(seed=0) as net: a = nengo.Ensemble(10, 1) p = nengo.Probe(a.neurons) with nengo.Simulator(net) as sim: sim.signals[sim.model.sig[a.neurons]['voltage']] = np.random.randn(10) sim.run_steps(5) print(sim.data[p])Colored by Color Scriptercs 이렇게 하면 net에 정의 된 a neuron에 input이 들어간다.
Neuron integrate and fire (IAF) model neuron은 membrane potential이 threshold에 닿았을 때 action potential이 fire한다.그 값은 대략 -55~-50mV 정도이다.Integrate and fire model(IAF model)은 membrane potential이 threshold value에 다다랐을 때, action potential이 발생한다. action potential이 발생한 이후에 potential은 reset 상태로 가면서 threshold 아래로 떨어지게 된다.threshold value는 로 표현하고, reset value는 으로 표현한다.따라서 의 관계가 만들어진다. IAF모델은 action potential에 대한 생물학적 작용을 무시함으로써 subthreshold의 membr..