/CSIM/CSIM_benchmark_3_hh_circuit.m

https://bitbucket.org/apdavison/spiking-network-benchmarks · Objective C · 76 lines · 64 code · 12 blank · 0 comment · 2 complexity · 8cefe67ca031c86e76a6a7b16d8ec13d MD5 · raw file

  1. %================================================================================
  2. %
  3. % CSIM implementation of a benchmark simulation described in the paper
  4. % "Simulation of networks of spiking neurons: A review of tools and strategies"
  5. % using the "Circuit Tools" available from www.lsm.tugraz.at.
  6. %
  7. % Benchmark 3: Conductance-based HH network. This benchmark consists of a
  8. % network of HH neurons connected with conductance-based synapses.
  9. %
  10. % The "Circuit Tools" and CSIM are freely available from www.lsm.tugraz.at
  11. %
  12. % Authors: Dejan Pecevski, dejan@igi.tugraz.at
  13. % Thomas Natschlaeger, thomas.natschlaeger@scch.at
  14. %
  15. % Date: April 2006
  16. %
  17. %================================================================================
  18. close all; clear csim;
  19. % Global parameter values
  20. ConnP = 0.02; % connectivity probability
  21. Tsim = 0.4; % duration of the simulation [sec]
  22. DTsim = 0.1e-3; % simulation time step [sec]
  23. Tinp = 50e-3; % length of the initial stimulus [sec]
  24. nInputNeurons = 10 ; % number of neurons which provide initial input (for a time span of Tinp)
  25. inpConnP = 0.01 ; % connectivity from input neurons to network neurons
  26. inputFiringRate = 80; % firing rate of the input neurons during the initial input
  27. % initialize an empty neural microcircuit object
  28. nmc = neural_microcircuit('dt_sim', DTsim);
  29. % Add a pool of Traubs HH Neurons to the circuit
  30. [nmc, pool] = add(nmc, 'pool', 'type', 'TraubsHHNeuron', ...
  31. 'size', [20 20 10], 'origin', [20 1 1], 'frac_EXC', 0.8, ...
  32. 'Neuron.Cm', 2e-10, 'Neuron.Rm', 100e6, 'Neuron.Vresting', -60e-3, 'Neuron.Vinit', -60e-3, ...
  33. 'Neuron.Vthresh', -50e-3, 'Neuron.doReset', 0, 'Neuron.Trefract', 5e-3, ...
  34. 'Neuron.Iinject', [0 0] ) ;
  35. % Create the connections in the network
  36. [nmc, cn] = add( nmc, 'Conn', 'dest', pool, 'src', pool, 'type', ... % connect pool with itself
  37. 'StaticSpikingCbSynapse', 'lambda', Inf, 'C', ConnP * ones(1,4), ... % connectivity does not depend on distance
  38. 'SH_W', 0, 'SH_delay', 0, 'rescale', 0, 'constW', 0, ... % no synaptic heterogeneity (SH)
  39. 'Synapse.delay', 0, ... % no transmission delay
  40. 'Synapse([EE IE]).W', 6e-9, 'Synapse([EE IE]).E', 0e-3, 'Synapse([EE IE]).tau', 5e-3, ... % excitatory synapses
  41. 'Synapse([EI II]).W', 67e-9, 'Synapse([EI II]).E', -80e-3, 'Synapse([EI II]).tau', 10e-3 ); % inhibitory synapses
  42. % Create the input neurons for the inital stimulation
  43. [nmc, inp] = add(nmc, 'pool', 'origin', [1 nInputNeurons 1], 'size', [1 nInputNeurons 1], ...
  44. 'type', 'SpikingInputNeuron', 'frac_EXC', 1);
  45. % Connect the input neurons to the network
  46. [nmc, cinp] = add( nmc, 'Conn', 'src', inp, 'dest', pool, ...
  47. 'type', 'StaticSpikingCbSynapse', 'lambda', Inf, 'C', inpConnP*ones(1,4), ...
  48. 'SH_W', 0, 'SH_delay', 0, 'rescale', 0, 'constW', 0, ...
  49. 'Synapse.W', 6e-9, 'Synapse.E', 0, 'Synapse.tau', 5e-3, 'Synapse.delay', 0);
  50. % Create the stimulus
  51. S = generate( constant_rate('nChannels', nInputNeurons, 'f', inputFiringRate, 'Tstim', Tinp) );
  52. % Record the spikes of some random neurons
  53. nmc = record(nmc, 'Volume', [20 1 1 ; 30 20 1 ], 'Field', 'spikes', 'dt', DTsim);
  54. % Record also the membrane potential of two neurons
  55. nmc = record(nmc, 'Volume', [30 10 5 ; 30 10 5], 'Field', 'Vm', 'dt', DTsim);
  56. nmc = record(nmc, 'Volume', [25 15 5 ; 25 15 5], 'Field', 'Vm', 'dt', DTsim);
  57. % Simulate the network
  58. tic; fprintf('Running simulation: ');
  59. reset(nmc);
  60. R = simulate(nmc, Tsim, S);
  61. fprintf('Done. %gsec CPU time for %gms simulation time\n', round(toc), Tsim*1000 );
  62. % Finally make some plots.
  63. % Note that plot_response is part of the circuit tools
  64. plot_response(R);