728x90 반응형 SMALL Brian5 [Brian] Example : Spiking model Hodgkin Huxley from brian2 import * num_neurons = 100 duration = 2*second # Parameters area = 20000*umetre**2 Cm = 1*ufarad*cm**-2 * area gl = 5e-5*siemens*cm**-2 * area El = -65*mV EK = -90*mV ENa = 50*mV g_na = 100*msiemens*cm**-2 * area g_kd = 30*msiemens*cm**-2 * area VT = -63*mV # The model eqs = Equations(''' dv/dt = (gl*(El-v) - g_na*(m*m*m)*h*(v-ENa) - g_kd*(n*n*n*n)*(v-EK) + I)/Cm : vol.. 2022. 2. 14. [Brian] Introduction to Brian part 3 : Simulations Multiple runs # remember, this is here for running separate simulations in the same notebook start_scope() # Parameters num_inputs = 100 input_rate = 10*Hz weight = 0.1 # Range of time constants tau_range = linspace(1, 10, 30)*ms # Use this list to store output rates output_rates = [] # Iterate over range of time constants for tau in tau_range: # Construct the network each time P = PoissonGroup(.. 2022. 2. 14. [Brian] Introduction to Brian part 2 : Synapses The simplest Synapse start_scope() eqs = ''' dv/dt = (I-v)/tau : 1 I : 1 tau : second ''' G = NeuronGroup(2, eqs, threshold='v>1', reset='v = 0', method='exact') G.I = [2, 0] G.tau = [10, 100]*ms # Comment these two lines out to see what happens without Synapses S = Synapses(G, G, on_pre='v_post += 0.2') S.connect(i=0, j=1) M = StateMonitor(G, 'v', record=True) run(100*ms) plot(M.t/ms, M.v[0], l.. 2022. 2. 14. [Brian] Introduction to Brian part 1 : Neurons running cell from brian2 import * %matplotlib inline # activate inline plotting Units system # Brian has a system for using quantities with physical dimensions 20*volt --> 20.0V 1000*amp --> 1.0kA 1e6*volt --> 1.0MV 1000*namp --> 1.0000000000000002μA 10*nA*5*Mohm --> 49.99999999999999mV A simple model start_scope() tau = 10*ms eqs = ''' dv/dt = (1-v)/tau : 1 ''' G = NeuronGroup(1, eqs) run(100*m.. 2022. 2. 11. Brian 2 Brian 2 Brian은 spiking neural network를 위한 시뮬레이터이다. Python 프로그래밍 언어로 작성되었으며 거의 모든 플랫폼에서 사용할 수 있다. # Installation conda install brian2 import brian2 brian2.test() https://brian2.readthedocs.io/en/stable/index.html Brian 2 documentation — Brian 2 2.5.0.3 documentation © Copyright 2012–2022, Brian authors Revision 2098ea0f. brian2.readthedocs.io 2022. 2. 11. 이전 1 다음 728x90 반응형 LIST