Home

User Manual

image

Contents

1. analog input auto save save_file_name file_format 8 1 NEWIOMODE Function AT 8 1 2 Input Arguments Input Name input_fun_name input_spike_time analog input auto_save save_file name file format Description Input function name This function must provide external analog current and spike times of input channels Must be a string Default value is none Spike times of inputs This value will be used if input function name was none Must be a cell array of the same size of the number of spiking inputs Each element of this cell array is a vector containing spike times of that input Note that if there was an input function name the spike time outputs of this function will be saved in this field Default value is 0 Analog current input values This value will be used if input function name was none Must be an array of the same size of the number of analog inputs Each element of this array corresponds to the analog current value of that input Note that if there was an input function name the analog current outputs of this function will be saved in this field Default value is 0 Auto save option If you want to save the results automatically when simulation com pleted set this variable value to 1 otherwise 0 You can specify the file name and file format using next input arguments Default value is 0 Save file name for auto save option Must be a string This value can also
2. lt a s ar aasa ma ee ewe eS RO SES 16 ARO es a ers oe ee NN oe 16 3 2 NEWARCHFC Function a 17 S ic a E E NF 17 pane Tpu AWN o eca eaea AAA AE 18 Ge Output OBJECT sace es kele d ee Ree Oe ee a 18 3AA Examples ca elias A 19 CONTENTS il ao NEWARCHEF Function o e s oko we Ved CW A RR ee 19 A oe eee he Rw CERES EGE ES YA ES 19 332 lapot AT csi a eee eR ee a a 20 Jao UU ODJECE e aao hE REE OH EOE ES 21 334 TIS lt a O Oe R a e wR R ars 21 34 NEWARCHGF PUBCON 4 ka RO a RRA dn 21 JAL OR a ee ee A A A A 0 21 J42 Input ATC ars eA GR e a 21 343 Outp t Object ne ean eee ea eke wee FN 21 344 Examples IATA 21 35 NEWARCHLO Function y sas YR A ee Y FU H A 21 Boe SYNER ST ee eae a as OA ee Ey 22 3 5 2 Input Arguments lt i ec s i pa RW WE ere ew 22 3 5 3 Output Object o eke eee eh ee eh BRE eR FM 22 eo ESP S y se oe eb eld dn HU ee O Owe ORE HES 22 36 NEWARGCHLE Function ss k eos ax s eave HG wae ee A 22 SD DN AO 22 36 2 Input Arguments eo erresa rra pedra pas 22 She Outpt CODI oss 4 444 44 eee Pee ka d RR HE 22 304 Examples cascara eR a RR oe Be dd 22 3 UCHECRAROH Function is s ei de eed eG RED EE ERS 23 Ga De E 23 oie Input APOIO s ca we od BEKO EH RRS ES 23 eles OII gt e dhe aie Sah ele be 8 O BES e e 23 4 Neuron Model 24 41 NEWNEURON Functioll bee soa UF a Ge Ew ee RR AH 24 LIA AM a G G eee eee eke wee RA 24 4 1 2 Input Arguments 44 coma ba eR a A 25 4 1 3 Output Object RIE 2
3. 0 then t t u t u 4 5 Default values for model and threshold function parameters are listed bellow Note that you must preserve the order of this table whenever you try to load other parameters into the model Also the default scale for each parameter is the same as what is displayed in this table C 1uF R 10k2 do 1 ur OMV uc 0 5mV 0 1mV 4 2 1 Syntax NeuronModel newneuronif if model model_param spike_det_fun_param re set_fun_param 4 2 2 Input Arguments Input Name Description if model Integrate and fire model name can be lin ear or quadratic Default value is linear model_param Parameters for the model Enter def for default values spike_det_fun Function name for spike detection algorithm Default value is threshold_fun spike_det_fun_param Parameters for the spike detection function Enter def for default values 4 2 3 Output Object The same as NEWNEURON 4 3 NEWNEURONHH Function 28 4 2 4 Examples 1 A quadratic model with following parameters R 20kQ C 4uF ay 2 4 0 5MV uce ImV NeuronModel newneuronif quadratic 4 20 2 0 5 1J 4 3 NEWNEURONHH Function This function creates a Hodgkin Huxley HH neuron model with following equa tions du C 1 lawam h u Ena gun u Ex gr u Er 46 H sal Bram 4 7 r A H 4 8 T T I 4 9 Original HH model does not have any spi
4. 3 2 inputs 1 spiking and 1 analog current Weights of all connections are drawn from random uniform distribution All delays are equal to one NetArch newarchff 3 4 2 2 1 1 1 1 1 1 1 1 1 O 0 random one 3 4 NEWARCHGF Function This function creates a feedforward multilayer architecture with general feedback i e the same as feedforward except that outputs of the last layer are connected to inputs of first layer 3 4 1 Syntax NetArch newarchgf neuron_num input num input type neuron type weight type delay_type 3 4 2 Input Arguments The same as NEWARCHFF 3 4 3 Output Object The same as NEWARCH 3 4 4 Examples The same as NEWARCHFF 3 5 NEWARCHLC Function This function creates a feedforward multilayer architecture with lateral connec tion for each layer i e the same as feedforward except that outputs of each layer are connected to inputs of the same layer 3 6 NEWARCHLF Function 22 3 5 1 Syntax NetArch newarchlc neuron_num input num input_type neuron_type weight_type delay_type 3 5 2 Input Arguments The same as NEWARCHFF 3 5 3 Output Object The same as NEWARCH 3 5 4 Examples The same as NEWARCHFF 36 NEWARCHLF Function This function creates a feedforward multilayer architecture with local feedbacks for each layer i e the same as feedforward except that outputs of the each layer are connected to inputs of the previous layer 3 6 1 Syn
5. SAREE a Se ae 34 Synapse Model 35 Sl NEWSYNAPSE Function lt o so ba caw gad oe awe ew we 36 AA o a eo KE REE EES EES Bw we ES 36 5 12 Input Arguments i cr oat 65 8 Se CR EF DH COR eS 36 Sik UU ODID cx serca he eee hw eee Em 37 SLA Examples lt lt ssc La RR BR PR ee eh A ER 37 52 CHECKSYNAPSE Function lt t ew ee ess 37 BL DU ee ac E A ee pe eh ed 37 522 Input o es e ers ewe R EE 37 GAS QUDS AI 37 Adaptation Model 38 61 NEWADAFT Pimetlon i i si cetei RH esi tatei kaai 38 AA EII 38 61 2 laat Arguments aci A 39 ME euch cS Meee hee Sede Y 39 61A epee 2 lt KEE EKER ED ESS EDS 40 62 CHECKADAPT Function os dieso g a A wk 40 DL CODE o A R R E AAA A E 40 Done pt ALE ros a e a 41 CONTENTS iv Oo OOS SE eg EYES SE eee wR ROE Go ee 41 7 Simulation Model 42 Tel NEWSIM PURO o eoe Gone ow dr GIG e H 42 AS A 42 7 1 2 Input Arguments Livra e A 43 Tie Output Object gt s eee ne eh RE UR AG cies 43 TIA Examples lt e cae be be ee Re eee AA 44 T2 CHECKSIM Function lt e seq as sea RR ER ee RR 44 PAS n ds A O O oe DP BG AA hak eh ok 44 72 2 Input Arguments 1 6 ba eh RAE ER EDR ER 44 Pee OUPS ce cae ea GA ae eee eS Eg 45 8 Input Output Model 46 bl NEWIOMODE Fimiction 2225654682454 89444 Rw eve 46 A 228 4 ese We Fu Ee D oe OS eee 46 O12 Input ATDWDIADES AA A T dad Output Ie ek hae se ia bee ed EG Y 48 E 6b eke KEE ERE HDG A HR Ud 48 82 CAECKIOMODE aaee occ 4 boda e de 48 EA o AI 49 S22 Inpu
6. Synapses Synapse model Adaptation Adaptation model Simulation Simulation model InputOutput Input Output model 9 1 4 Examples 1 A BNN model with default objects 9 2 CHECKBNN Function 52 net newbnn 9 2 CHECKBNN Function This function checks a BNN model for errors and returns a message and a flag indicating the condition of the model It uses previous object check functions 9 2 1 Syntax CheckMessage CheckFlag checkbnn net 9 2 2 Input Arguments A BNN model 9 2 3 Outputs Output Name Description CheckMessage A string containing the error condition of the object OK for no error situation CheckF lag An integer for associated condition 1 for no error situation Chapter 10 Simulate a BNN This chapter explains how to simulate a BNN model build with previous func tions 10 1 SIMBNN Function This is the main function to simulate a BNN model 10 1 1 Syntax net simbnn net 10 1 2 Input Arguments Input Name Description net A BNN model 10 1 3 Output Object The output object is the same as the input BNN model The output fields would have the results of the simulation 10 1 4 Examples 1 Simulate a BNN model net simbnn net Chapter 11 Tools This chapter contains some additional functions used for accessing and plotting the results easily 11 1 GETSTATES Function This function returns solved state values of a particular neuron 11 1 1 Syntax states getstates
7. a structure variable containing the fields listed below 6 2 CHECKADAPT Function 40 Field Name Weight AdaptFun Weight AdaptFunParam Delay AdaptFun Delay AdaptFunParam Threshold AdaptFun Threshold AdaptFunParam Model Adapt Fun Model AdaptFunParam 6 1 4 Examples Description Function name for weight adaptation mechanism Parameters for weight adaptation func tion Function name for delay adaptation mechanism Parameters for delay adaptation func tion Function name for threshold adapta tion mechanism Parameters for threshold adaptation function Function name for model adaptation mechanism Parameters for model adaptation func tion 1 An adaptation model with default values AdaptModel newadapt 62 CHECKADAPT Function This function checks an adaptation object for errors and returns a message and a flag indicating the condition of the object 6 2 1 Syntax CheckMessage CheckFlag checkadapt AdaptModel 6 2 CHECKADAPT Function Al 6 2 2 Input Arguments An adaptation object 6 2 3 Outputs Output Name _ Description CheckMessage A string containing the error condition of the object OK for no error situation CheckFlag An integer for associated condition 1 for no error situation Chapter 7 Simulation Model This chapter contains the description of the Simulation component The simula tion object contains information needed for a solver to
8. format so after downloading it you will need a decompressor program to unzip the files There is also an extra decompressor MATLAB program on the website for those unable to unzip the toolbox Unpack the toolbox files into any directory you wish and then run the install m file in the root directory of the toolbox This program will add the toolbox directories into the MATLAB search path enabling MATLAB to find toolbox functions You can change the toolbox directory any time later but be sure to run the installation file again or add the new paths manually Now you are ready to start working with the toolbox 1 4 Support The author would do his best to provide a good email supporting system for any kind of help regarding this toolbox Please state your questions clearly and if possible with the related programs THIS SOFTWARE COMES WITH NO WARRANTY WHATSOEVER THE AUTHOR IS NOT RESPONSIBLE FOR ANY DAMAGE CAUSED BY THE MIS USE OF THIS SOFTWARE Chapter 2 Basics of BNN A Biological Neural Network or simply BNN is an artificial abstract model of different parts of the brain or nervous system featuring essential properties of these systems using biologically realistic models Neurons in the CNS commu nicate using short duration pulses called action potentials or spikes which the basic features of these signals such as amplitude and temporal properties are not different for a population of neurons in a certain part of the CNS So the b
9. the main role of a PSP function is to get the spike times and to return the current value in an appropriate format You can use any other functions rather than external_input and internal_input if the previous steps are not suitable for you model To write anew PSP function you can use the template function This function is the same as the a function PSP model for internal spikes discussed earlier except that it has help sections about how to modify the template with your code Follow these steps to create your model 1 First of all take a copy of this file rename it to mv model name for example int_fire2 Also change the name of function at the first line from synapse_model_template to my model name Put default parameters for your model at the specified section If you want to get other parameters rather than defaults from outside change these codes according to your model Note that you must preserve the parameters order here and outside to get the correct results Put your PSP function in the specified section Save your file 12 4 How to Add Adaptation Model 63 12 4 How to Add Adaptation Model There is no template file for adaptation model since there is no adaptation mechanism available in this release But as a general rule writing an adaptation function is not a complicated task This function must get the BNN model as its input Then it should modify the parameters such as weights acc
10. 0 otherwise Please refer to chapter 9 for more information about adding custom synapse models to the library and also the structure of functions This chapter continues with description of basic synapse component and library items available for this version 5 1 NEWSYNAPSE Function This is the main function for custom synapse model component definition 5 1 1 Syntax SynapseModel newsynapse ext_psp fun ext_psp fun_param int_psp fun int_psp_fun_param 5 1 2 Input Arguments Input Name Description ext_psp_fun Function name for external PSP Must be a string Available library PSP func tions are alpha fun ext alpha fun2 ext delta fun ext Default value is al pha fun ext external a function ext_psp_fun_param Parameters for the external PSP function Enter def for default values int_psp_fun Function name for internal PSP Must be a string Available library PSP func tions are alpha fun int alpha_fun2_int delta fun int Default value is al pha fun int internal a function int_psp_fun_param Parameters for the internal PSP function Enter def for default values 5 2 CHECKSYNAPSE Function 37 5 1 3 Output Object The output object is a structure variable containing the fields listed below Field Name Description External ExtPSPFun Function name for external PSP External ExtPSPFunParam Parameters for external PSP function Internal IntPSPFun F
11. 2 1 8 Simulating BNN The final step is to simulate the BNN model using following command network simbnn network Now we can run this program with either executing the example in command window or selecting Run from Debug menu of the m file editor Note the messages appearing in the command window with each successful execution of program commands With each spike generation the current time of simulation is also shown After the completion of simulation the membrane potentials are displayed in a figure 2 2 Summary Summarizing the example presented above to create and simulate a BNN model properly some basic components must be specified first and then combined to gether to build a BNN object This object can be simulated and the results can be plotted using provided tools In next chapters each component will be described in details separately In addition available library items will be presented Defining custom models and adding them to the library will be explained using function templates Chapter 3 Architecture Model This chapter contains the description of the Architecture component and its variants The most important factor for an architecture object is the topology of connections Throughout the rest of the toolbox the following standard will be used For any connection from input source j to destination 7 a will represent the synaptic weight or transmission delay of that connection Using this standard
12. 5 41A Examples o so ecic EE FR UR RE REU nh e 26 A NEWNEURONIF Funchon See RE BER RR aa 26 LEL AI os ra ds OOKOIO eC 2 A22 Input Arguments sesca O O R R R eS Bw 27 ALS Output Objet es es a ea e fae aw na hae a eas 27 Oe TIEN lt e Y O ee AA 28 13 NEWNEURONHH Function e e s se creerse Ed 28 Mol Do aer ed e Sele aoe 28 Jo Taput API o ecs cinesi ara A BOS 29 Aog Output ORIG seca naeia Ek oek a ORD ee aei 29 Spe ESCAPES Serias da A HY ES 29 4A NEWNEURONEN Punction oc s 6 644 6 hee aoe WR as vo 29 AA AU ee he oR eS A SESE Ee SS 29 CONTENTS iii AA put ARIES oco s ocho a Yow eo eee Ee i 30 2432 Output Obje aros be Re ES ROE ES RR ME 30 BAS Example bcs eee SS ERE BEE eee RW 30 45 NEWNEURONML Function a 30 A o A R me R ee oe we NN 31 A52 a sensis 4 aia a ES RASS 31 Boer Output ODJECE lt a A Sw we 31 ASA PS oc occ eee ERAGE RAGA E EH EES 31 4 6 NEWNEURONCANON Function al AGA Sym GR ER RR ER RR RR DR RR UA 31 4 6 2 Input Arguments ora we ee a2 4 6 3 Output Object S L ba eae Cte ER e ARR 32 4GA nc MAT ke Ok eR O OM REF ee 32 4 7 NEWNEURONIZ Function 0200 4 32 VAE o dg pasee Bm Be eee OK awe Oe eed 32 A a A RY oe eR BO 33 A CIEE ss eo era Si ra Kw dB He GA 33 Ada SUIS see et Ae we A 33 AB CHECKNEURON Function s se e tedar ac 33 ABl DUO e ee a EMER ee eee ee Been a EN 33 A82 laput ALCUMEI S o ece ed oe eK eS YEE SEE k keii 33 a OGG cs see a EY
13. 6 3 Output Object A figure 11 6 4 Examples 1 Plot spike times in 2D plotspikes2d net Chapter 12 How to Add to Library This chapter describes how to add models to the library using function templates To understand this issue it s necessary to illustrate the details of the simulator program and other associated functions first 12 1 Details of Simulator SIMBNN is the main simulator program The process of simulation in this function has the following steps 1 2 Checks the BNN model for errors using CHECKBNN function Initializes some internal variables Sets the simulation current time to start time Creates event spike detection function for the MATLAB ODE solver Generalizes initial conditions If the size of initial condition vector does not match with the total number of states in the BNN model checks to see if its size is the same as the number of states for a single neuron If the check result was true it would repeat this initial condition vector for all other neurons Otherwise if the original initial condition was a single value the function would make a vector for initial condition filled with this value for all states in the network Starts the computation loop by calling the MATLAB ODE solver with following arguments DEs function of the neuron model current time stop time initial condition and event function The solver starts to integrate the DEs and stop whenever the computat
14. BIOLOGICAL NEURAL NETWORKS BNNs TOOLBOX FOR MATLAB USER GUIDE Amir Reza Saffari Azar Alamdari VERSION 1 0 http www ymer org August 2004 Contact Addresses EMAIL amir ymer org WEBSITE http www ymer org ALT WEBSITE http ee sut ac ir faculty saffari main htm COMMUNITY http groups yahoo com group computational neuronscience ADDRESS No A3 2nd floor Cheshm Andaz Moalem Str Vali Asr Tabriz Iran Contents 1 Introduction 2 1 1 What is BNN Toolbox o a ie kc ere Ge a a da a AU RR 2 1 2 Overview and Features 2 2 2 3 1 21 Curent Features o csoc eo te do o HY a l 3 122 Future Outlook 2 ncc 68 644 64648 24 44 244 yd 5 1 3 Installation Guide 0 e 6 Lal Re g irements ssa css m ER RAE hee ER EE 6 1 3 2 Howto mstall sciu bn FR YF ae ee ee ee 7 LA DUO lt e e w eek Ph ede eh puni eh eae AA RR GE T 2 Basics of BNN 8 21 Componente ora BNN esses a a ER IR WEAR y 8 21 1 Archmecbuwf6e 2c R R ee eR OER RR ER RSS 9 2 12 Neuron Model ees seser 2402 ed a teri 9 Ale Synapse Model lt lt s ssicsssdren td et kWa 9 214 Adaptation Model fa 6408 6 ra GES i e e 10 21 5 Simulation Parameters gt s swe RR doe ww SS 10 ZU mpu OEA eee e Gee e eek dw Wek T A 2 10 217 BNN Model ocios cis GRAA GG A de yd 11 215 oll BNN a coo g ee ee we Ee we Ee ers 11 22 AUN 0 E R ss A ee A a d 11 3 Architecture Model 12 3 1 NEWARCH Function 12 A AA 13 RA II 15 S Output ODISEA
15. ameter in neuron object to a matrix containing parameters for each neuron in a row i e each column corresponds to one of parameters and each row has the parameters for that neuron 4 Put the DEs equations in the specified section Use dotted arithmetic operations if you have different parameters for different neurons 5 Save your file There is a line of code in this template for dendritic currents calculations external input t y internal_input t y These functions will be explained in next sections 12 3 How to Add Synapse Model To add a synapse model to the library you can use the synapse_model_template m program from the template directory To have a backup from the template it is recommended to copy this function with your model name and then modify its contents according to the instructions bellow To gain more insight into the synapse models let s explain the procedure of PSPs calculations As stated before the total dendritic input current to a neuron is asummation of external and internal inputs Each neuron model function must have some functions or a section in the same function to calculate this value for all neurons in the network There are two predefined functions associated with this problem in the toolbox external_input and internal_input These two functions has the same structure except that an additional section is available in external_input for analog injection currents The procedure of calculat
16. asic feature of a BNN is to use spiking neurons instead of traditional firing rate models also known as sigmoidal neurons used in ANNs Because of this spiking behaviour in most cases Spiking Neural Networks SNNs term is used instead of BNNs for these models The basic components of a BNN model is described in next section using a very simple and illustrative example explaining the essential features of the toolbox It is recommended for beginners in computational neuroscience to read some reference books regarding modeling aspects of neuronal systems since this manual is not going to repeat them here It is supposed throughout this guide that the user has the eseential knowledge of spiking neurons 2 1 Components of a BNN Let s start this section with a simple example Suppose we want to simulate a network of three fully connected integrat and fire neurons using this toolbox The source code for this example is available in the examples directory of the toolbox under examplel m Most of the functions in this example use default values for their input arguments This will simplify the introduction process Note that the full description of the commands and their input arguments will be given in next chapters To open this example in a m file editor execute edit examplel in command window or run Open option from File menu and select examplel m The first three lines of the example are just clean up tasks it clears command window current figu
17. compute the solution of the BNN model 7 1 NEWSIM Function This is the main function for custom simulation model component definition 7 1 1 Syntax SimParam newsim stop time start_time initial cond solver type solver option stop fun user fun 7 1 NEWSIM Function 43 7 1 2 Input Arguments Input Name stop_time start_time initial_cond solver_type solver_option stop_fun user_fun Description Simulation stop time Must be greater than zero and start time Default value is 0 no simulation Simulation start time Must be greater than zero and less than stop time Default value is O no start Initial condition of state variable A vector with the same size of the total state variables of the network Default value is 0 MATLAB solver type selection Must be one of ode45 ode23 odell3 odel5s ode23s ode23t or ode23tb Refer to MATLAB help for more information about the solvers Default value is ode45 MATLAB solver option There is no option in this release Must be for this version User defined stop function used to define stopping criteria rather than stop time Must be a string Default value is none no stop function User defined function used to define func tions not included in the toolbox Must be a string Default value is none no user func tion 7 1 3 Output Object The output object is a structure variable c
18. connection topology of the network can be repre sented using four matrixes two for interneuron connection weights and delays and two for inputs neurons connection weights and delays If we have N neurons and M external inputs in the network then the size of the first two matrixes is N x N and the last two is N x M These matrixes will be used by the simulation programs later Note that a zero value for the synaptic weight of a specific connection would result in a disconnection between source and destination Note that all timings in this toolbox are in msec scale 3 1 NEWARCH Function The main function for the architecture component generation is the NEWARCH The following lists describe the input arguments output object and default val ues for this function Note that the input arguments must be entered only in the specified order This is a very important issue when you want to use the default value for an argument Let s state this problem with an example suppose there is function y f a b with two input arguments If you enter y f 2 3 the function will take a 2 and b 3 If you enter y f 2 the function will take a 2 and will insert the default value for b If you enter nothing y f then the function will assume both default values for the a and b 3 1 NEWARCH Function 13 3 1 1 Syntax NetArch newarch neuron_num input_num input_type neuron_type input_weight neuron_weight input_delay neuro
19. cribed by if u gt 0 then f t v tt c u tt u t 4 d 4 21 Default values for model and reset function parameters are listed bellow Note that you must preserve the order of this table whenever you try to load other parameters into the model a 0 02 b 0 2 c 65 d 8 0 30 4 7 1 Syntax NeuronModel newneuroniz model_param spike_det_fun_param reset_fun_param 4 8 CHECKNEURON Function 33 4 7 2 Input Arguments Input Name Description model_param Parameters for the model Enter def for default values spike_det_fun_param Parameters for the spike detection function Enter def for default values reset_fun_param Parameters for the reset function Enter def for default values 4 7 3 Output Object The same as NEWNEURON 4 7 4 Examples 1 An Izhikevich model with following properties a 0 01 b 0 3 c 70 d 6 5 0 20 NeuronModel newneuroniz 0 01 0 3 20 70 6 5 4 8 CHECKNEURON Function This function checks a neuron object for errors and returns a message and a flag indicating the condition of the object 4 8 1 Syntax CheckMessage CheckFlag checkneuron NeuronModel 4 8 2 Input Arguments A neuron object 4 8 CHECKNEURON Function 34 4 8 3 Outputs Output Name _ Description CheckMessage A string containing the error condition of the object OK for no error situation CheckF lag An integer for associated condition 1 f
20. e m program from the template directory To have a backup from the template it is recommended to copy this function with your model name and then modify its contents according to the instructions bellow Each neuron model function has the DEs or more exactly the ODEs of that particular model This function takes current time t and state vector y as input arguments and returns the derivative of state variables 2 The general structure of a neuron model is given by dy dt which y is the state vector F t y is the internal dynamics and t y is the total external or internal dendritic current The template function is the same as the leaky integrate and fire model dis cussed earlier except that it has help sections about how to modify the template with your code Follow these steps to create your model PL y 1 t y 12 1 1 First of all take a copy of this file rename it to mv model name for example int_fire2 Also change the name of function at the first line from neuron_model template to my_model_name 12 3 How to Add Synapse Model 61 2 Put default parameters for your model at the specified section 3 If you want to get other parameters rather than defaults from outside change these codes according to your model Note that you must preserve the parameters order here and outside to get the correct results Another point is that you can specify different parameters for each neuron by setting model par
21. ease There will be a Simulink blockset for simulating BNNs using MATLAB Simulink This will highly increase the flexibilities of this toolbox with linking it to other Simulink libraries There will be a variant of this toolbox for those users without MATLAB software So they will be able to run this toolbox as a stand alone software Next versions will be much faster than this version in simulating models The library will have more models for neurons synapses and architectures If you have a model and wishing it to be included in next releases please contact the author The adaptation library will be added containing various learning mecha nisms for different parts of the system The possibility to simulate continuous time equations such as SRM will be added 4Graphical User Interface 1 3 Installation Guide 6 e Modular architecture will be added to provide a tool for simulating modular and hierarchical network models e It is possible to add some specific tools for simulating compartmental models of neurons and networks Since there are other highly specialized packages for this reason such as NEURON or GENESIS this function is not covered in this release but might be included if users wish for such a feature e The programming style for essential definitions of this software will be changed to OOP style using Classes and Objects programming of MATLAB e It would be provided to export the simulation results i
22. ero for all weights equal to zero Default is random A string indicating how to initialize the de lay matrixes random for a random uniform distribution one for all delays equal to 1 and zero for all delays equal to zero De fault is zero 3 2 3 Output Object The same as NEWARCH 3 3 NEWARCHFF Function 19 3 2 4 Examples 1 A fully connected network architecture with following properties 4 neurons 1 excitatory 2 inhibitory 1 hybrid 2 inputs 1 spiking and 1 analog current Weights of all connections are drawn from random uniform distribution All delays are equal to one NetArch newarchfc 4 2 1 1 1 1 1 0 random one 33 NEWARCHFFE Function This function creates a feedforward multilayer architecture i e neurons are di vided into groups called layers The layers have an order which outputs of layer number n is connected only to inputs of layer number n 1 Inputs are only connected to layer number 1 3 3 1 Syntax NetArch newarchff neuron_num input_num input type neuron_type weight_type delay type 3 3 NEWARCHFF Function 20 3 3 2 Input Arguments Input Name neuron_num input_num input_type neuron type weight_type weight type Description Number of neurons in each layer INi Na Ni for a network with k layer and N neurons in layer number 7 Default is a single layer network with random number of neurons bet
23. es 12 How to Add to Library 12 1 Details of Simulator 12 2 How to Add Neuron Model 12 3 How to Add Synapse Model 12 4 How to Add Adaptation Model 13 References 54 54 54 54 54 59 59 59 59 59 59 56 56 56 56 56 56 56 56 57 57 57 57 57 97 57 58 58 58 58 58 59 59 60 61 63 64 Chapter 1 Introduction 1 1 What is BNN Toolbox Biological Neural Network BNN Toolbox is MATLAB based software to sim ulate network of biological realistic neurons as an abstract model of brain and Central Nervous System This software enables user to create and simulate var ious BNN models easily using built in library models and just in a few lines of code User can also create custom models and add them to the library using library templates A set of very descriptive examples are available to give a quick introduction to the toolbox and to reduce the coding time for beginners In addi tion this toolbox only covers spiking models of neurons and biologically plausible network components To simulate firing rate models also known as ANN there exists very well designed packages such as Neural Network Toolbox of MATLAB This toolbox uses powerful MATLAB programming language MATLAB is a popular computation platform with highly specialized and powerful toolboxes for most scientific and engineering fields To use all benefits of this toolbox user must have an essential knowledge of programmi
24. esponds to transmission delay of connection from jth input to ith neuron Note that the time scale is msec Default is a zero for all connections A matrix of size N x N each element a cor responds to transmission delay of connection from jth neuron to ith neuron Note that the 3 1 NEWARCH Function 16 3 1 3 Output Object The output object is a structure variable containing the fields listed below To access a particular field use ObjectName FieldName style For example if the object name is NetArch the NetArch NeuronNum will refer to number of neurons in this object All of other architecture functions use this structure as output argument Field Name Description NeuronNum Number of neurons in the network InputNum Number of inputs in the network Input Type Input types vector NeuronType Neuron types vector Input Weight Input connections weight matrix Neuron Weight Interneuron connections weight matrix InputDelay Input connections delay matrix NeuronDelay Interneuron connections delay matrix 3 1 4 Examples 1 A network architecture with following properties 4 neurons 1 excitatory 2 inhibitory 1 hybrid 2 inputs 1 spiking and 1 analog current Weights of all connections are equal to 1 All delays are 0 5msec NetArch newarch 4 2 1 1 1 1 1 O ones 4 2 ones 4 4 0 5 ones 4 2 0 5 ones 4 4 2 A network architecture with 10 neurons and 5 inputs All other values are set
25. have the relative or absolute address Default value is bnnet Save file format for auto save option Must be a string Only MAT is allowed in this version 8 2 CHECKIOMODE Function 48 8 1 3 Output Object The output object is a structure variable containing the fields listed below Field Name Description Input nputFunName Input function name Input InputSpikeTime Spike times of inputs Input AnalogInput Analog current input values Output SpikeTimes Neurons spike times A cell array of the same size of the number of neurons Output States States values of network Each column of this matrix corresponds to one of the states Output Time Time vector A vector containing the time values of computations Output AutoSave Auto save option Output SaveFileName Auto save file name Output FileFormat Auto save file format 8 1 4 Examples 1 An input output model with following properties 2 spiking input with spike times 2 4 8 3 10 msec 1 analog input 214 auto save on and save file to the results directory with network file name IOMode newiomode none 2 4 8 3 10 2 1 results network 82 CHECKIOMODE Function This function checks an input output object for errors and returns a message and a flag indicating the condition of the object 8 2 CHECKIOMODE Function 49 8 2 1 Syntax CheckMessage CheckFlag checkiomode IOMode 8 2 2 Input Arguments An input
26. ion time reaches to stop time or an event is detected using spike detection function At this time the solver stops the integration and returns states matrix spike times index of spiker neuron and computation time vector 12 2 How to Add Neuron Model 60 6 The program stores new results in the proper output fields of BNN model and sets updates current time with the final value of the time vector 7 It then calls the reset function for post spike generation processes with state matrix and index of spiker neuron This function must return new initial conditions for next steps of integration 8 The program calls adaptation functions to perform learning mechanisms over adjustable parameters The adaptation functions receive the BNN model as input and must return the modified BNN model 9 If there was any user defined or stop function it calls them with BNN model as input User defined function must return a BNN model Stop function must return the new stop flag condition 0 for continue and 1 for stop 10 The program checks current time If current time was not greater than stop time and also stop flag was not equal to 1 then continues the simulation by going to step 5 otherwise it goes to next step 11 If the auto save option was selected it saves the BNN model and then returns back the BNN model to the original program 12 2 How to Add Neuron Model To add a neuron model to the library you can use the neuron_model_templat
27. ions in these files is 1 Initialization of variables 2 Separates the spiking inputs from analog inputs external_input function only 3 Checks for input file name If there was such a function then it calls this function with t and y as input arguments and gets analog input values 12 3 How to Add Synapse Model 62 together with input spike times in the same structure as stated in InputOut put chapter If there was not any input function then it reads the input fields of BNN model If the size of the spike times cell array was equal to 1 and it does not match with the total number of spiking inputs the function automatically generalizes this spike time to all other spiking inputs external_input function only If the size of the analog input array was equal to 1 and it does not match with the total number of analog inputs the function automatically gener alizes this analog value to all other analog inputs external_input function only The program then checks for PSP function name If there was a PSP func tion then it calls the PSP function with t y spike times and transmission delay values as input arguments The PSP function must return a matrix with a proper size Each a element of this matrix corresponds to the dendritic current value from jth source to ith neuron at that time The final step is the computation of weighted sum of total dendritic currents for all neurons As seen from above
28. ke detection and reset function But because the simulator program has to detect the spike generation event we added a threshold function to this model The default value for this threshold is OmV Default values for model parameters are listed bellow Note that you must preserve the order of this table whenever you try to load other parameters into the model Also the default scale for each parameter is the same as what is displayed in this table JNa 120 gx 36 gr 0 3 Ena 50mV Ex TTmV Er 54 4mV C pF 4 3 1 Syntax NeuronModel newneuronhh model_param spike det fun_param 4 4 NEWNEURONEN Function 29 4 3 2 Input Arguments Input Name Description model_param Parameters for the model Enter def for default values spike_det_fun_param Parameters for the spike detection function Enter def for default values 4 3 3 Output Object The same as NEWNEURON 4 3 4 Examples 1 A HH model with following parameters gwa 110 9n 40 9 0 5 Ena 60mV Ex 80mV Er 60mV C 2uF NeuronModel newneuronhh 110 40 0 5 60 80 60 2 4 4 NEWNEURONFN Function This function creates a FitzHugh Nagumo FN neuron model with following equations dv a v v aw 1 w I 4 10 dw e i E 11 E v yw 4 11 Like HH model original FN model does not have any spike detection and reset function But because the simulator program has
29. ment 4 2 NEWNEURONIF Function 26 Field Name Description Model NeuronFun Function name containing neuron s DEs Model ModelType Model type Model StateNum Number of state variables in the DEs Model ModelParam Parameters for the model SpikeDet SpikeDetFun Function name for spike detection algo rithm SpikeDet SpikeDetFunParam Parameters for the spike detection function Reset Reset Fun Function name for reset algorithm Reset ResetFunParam Parameters for the reset function 4 1 4 Examples 1 A Hodgkin Huxley neuron with standard parameters and a spike detection function using a threshold of 10mV NeuronModel newneuron hodgkin_huxley CDE 4 def hh_threshold_fun 10 none def 2 A leaky linear integrate and fire neuron with reset potential set to lmV All other values are set to default NeuronModel newneuron int_firelin CDE 1 def reset fun 1 def threshold fun 4 2 NEWNEURONIF Function This function creates an integrate and fire neuron object There are two different type of this model in the library 1 Leaky linear integrate and fire see Eq 4 1 2 Quadratic nonlinear integrate and fire see Eq 4 2 4 2 NEWNEURONIF Function 27 du Ina u t RI t 4 2 Tm ag u ur u ue RI t 4 3 Tm RC 4 4 Spike detection and after spike reset is described by is the most recent spike time if u gt
30. n different file for mats such as Excel Next release will be within 3 months from this one 1 3 Installation Guide 1 3 1 Requirements Here is the check list for the essential requirements to run this toolbox e MATLAB version 7 0 or 6 x See Notes section below for more information e The latest version of the BIOLOGICAL NEURAL NETWORKS TOOLBOX FOR MATLAB Notes Since MATLAB system is a script interpreter you need to have MATLAB running on your computer to execute this toolbox and of course any other MAT LAB program Because of this feature most of the MATLAB programs are OS independent if one does not use features provided for a specific OS So there is no restriction about the system specifications including hardware and operating system except that it must have a MATLAB installed on it and also be capable of running MATLAB properly The toolbox is originally developed using MATLAB 7 0 Release 14 and is tested successfully with MATLAB 6 x Release 13 under Microsoft Windows 2000 Professional You need also to download the latest version of this toolbox and re lated documentation from http www ymer org from the alternative web site http ee sut ac ir faculty saffari res bnntoolbox htm or from the computational neuroscience community http groups yahoo com group computational neuroscience 5Object Oriented Programming 1 4 Support 7 1 3 2 How to install The toolbox files are compressed into a zip file
31. n_delay 3 1 NEWARCH Function 14 3 1 NEWARCH Function 15 3 1 2 Input Arguments Input Name neuron_num input_num input type neuron type input_weight neuron weight input_delay neuron_delay Description Number of neurons in the network N Must be an integer greater than zero Default is a random number between 1 and 11 Number of inputs in the network M Must be an integer than zero Default is a random number between 1 and 11 A vector of size M each element corresponds to one of inputs There are two different types of inputs spiking and analog current For spiking insert 1 and for analog current insert 1 Default is spiking for all inputs A vector of size N each element corresponds to one of neurons There are three differ ent types of neurons excitatory inhibitory and hybrid can be both excitatory and in hibitory at the same time For excitatory insert 1 for inhibitory insert 1 and for hybrid insert 0 Default is randomly chosen excitatory inhibitory neurons A matrix of size N x M each element as corresponds to synaptic weight of connection from jth input to ith neuron Default is a random matrix drawn from a uniform distri bution A matrix of size N x N each element as corresponds to synaptic weight of connection from jth neuron to ith neuron Default is a random matrix drawn from a uniform distri bution A matrix of size N x M each element a cor r
32. net neuron_no 11 1 2 Input Arguments Input Name Description net A BNN model after computations neuron_no Neuron number in the network If you want to get state values for all neurons don t in sert this argument 11 1 3 Output Object State values in a vector for a single neuron or in a matrix for all neurons with each column for a neuron 11 2 GETSPIKES Function 55 11 1 4 Examples 1 Get state values for 2nd neuron states getstates net 2 2 Get state values for all neurons states getstates net 11 2 GETSPIKES Function This function returns spike times of a particular neuron 11 2 1 Syntax spike_time getspikes net neuron_no 11 2 2 Input Arguments Input Name Description net A BNN model after computations neuron_no Neuron number in the network If you want to get spike time for all neurons don t insert this argument 11 23 Output Object Spike times in a vector for a single neuron or in a cell array for all neurons with each elemnt for a neuron 11 2 4 Examples 1 Get spike times for 2nd neuron spike_time getspikes net 2 2 Get spike times for all neurons spike_time getspikes net 11 3 GETTIME Function 56 113 GETTIME Function This function returns computation time vector 11 3 1 Syntax time gettime net 11 3 2 Input Arguments Input Name Description net A BNN model after computations 11 33 Output Object Time vector of computa
33. ng in MATLAB or other similar popular languages such as C C or PASCAL But a very small experience in defining variables and function usage is also suffices to use this package User also can gain this by tracking example codes Note that this constraint will be removed in next versions using a user friendly GUI system The main idea behind the first release is to present the essential concepts of a general biological nervous system simulator in MATLAB environment and gather feedback from users to improve next releases So it is appreciated very much for any kind of comments bug reports and discussions These feedbacks are believed to be the essential keys to keep this toolbox improving and evolving in the future This toolbox is created and developed by personal interests of the author in ICNS 2 Artificial Neural Networks 1 2 Overview and Features 3 modeling brain and CNS and is provided to other users as an open source free software under GNU GPL Feel free to copy modify and distribute it according to the license To obtain the latest version of GPL please refer to http www gnu org Note that MATLAB itself is a commercial software provided by The MathWorks Inc http www mathworks com 1 2 Overview and Features As the name of the toolbox implies the main goal of this software is to provide users a set of integrated tools to create models of biological neural networks and simulate them easily without the need of ex
34. on of basic synapse component and library items available for this version 6 1 NEWADAPT Function This is the main function for custom adaptation model component definition 6 1 1 Syntax AdaptModel newadapt adapt_fun_weight adapt_fun_weight_param adapt_fun_delay adapt_fun_delay_param adapt_fun_threshold adapt_fun_threhsold_param adapt_fun_model adapt_fun_model_param 6 1 NEWADAPT Function 39 6 1 2 Input Arguments Input Name Description adapt fun weight Function name for weight adaptation mech anism Must be a string Default value is none no adaptation adapt_fun_weight_param Parameters for the weight adaptation func tion Enter def for default values adapt fun delay Function name for delay adaptation mech anism Must be a string Default value is none no adaptation adapt_fun_delay_param Parameters for the delay adaptation func tion Enter def for default values adapt_fun_threshold Function name for threshold adaptation mechanism Must be a string Default value is none no adaptation adapt_fun_threshold_param Parameters for the threshold adaptation function Enter def for default values adapt_fun_model Function name for model adaptation mech anism Must be a string Default value is none no adaptation adapt_fun_model_param Parameters for the model adaptation func tion Enter def for default values 6 1 3 Output Object The output object is
35. ontaining the fields listed below 7 2 CHECKSIM Function 44 Field Name StopTime StartTime InitialCond Solver SolverOption StopFun UserFun 7 1 4 Examples Description Simulation stop time Simulation start time Simulation initial conditions Solver function Solver options Stop function User function 1 A simulation model with following properties start time 0 stop time 20 initial condition 1 note that when you enter a single value for initial condition the function will automatically generalize it for all other states SimParam newsim 20 0 1 7 2 CHECKSIM Function This function checks a simulation object for errors and returns a message and a flag indicating the condition of the object 7 2 1 Syntax CheckMessage CheckFlag checksim SimParam 7 2 2 Input Arguments A simulation object 7 2 CHECKSIM Function 45 7 2 3 Outputs Output Name _ Description CheckMessage A string containing the error condition of the object OK for no error situation CheckFlag An integer for associated condition 1 for no error situation Chapter 8 Input Output Model This chapter contains the description of the Input Output component This modules defines how the model will interact with inputs and outputs 8 1 NEWIOMODE Function This is the main function for custom input output model component definition 8 1 1 Syntax IOMode newiomode input fun name input_spike time
36. or no error situation Chapter 5 Synapse Model This chapter contains the description of the Synapse component and its variants Two essential parts of a synapse model are 1 External PSPs 2 Internal PSPs Eq 5 1 gives the general structure of a synapse model T t x gee Tee Tie 5 1 which I t x is the total input current to a neuron 2 9 is the external analog current injected to a neuron Ke is the PSP due to external spiking inputs and J5P F is the PSP because of spikes from other neurons in the network Since the current injection is not related to synapses the synapse object only has the properties of the effects of spiking inputs There are three different PSP functions in the library 1 a function pke Y y wy exp default 7 10msec 2 a function2 mke DDD wplexrp E exp Hi de fault 7 10msec Tm 5msec 3 Delta function ke Y Y w d t t dy default ValidPeriod 2msec which mike is the spike related input current for a neuron wy and dy are synaptic weight and transmission delay for kth connection respectively H is the jth input spike time from kth synapse Ts and Tm are time constants t is the Dirac delta function Since realizing delta function is not possible in computations this function is replaced with a square pulse function given bellow 5 1 NEWSYNAPSE Function 36 1 0 lt t lt ValidPeriod Pt
37. ording to the learning algorithm And at last stores them in the appropriate fields in the BNN model and returns it as output argument Next release will have adaptation functions and templates Chapter 13 References This chapter contains some useful references for models used in this toolbox 1 Gerstner W Kistler W M 2002 Spiking Neuron Model Single Neuron Populations and Plasticity Cambridge University Press 2 Maass W Bishop C M 1998 Pulsed Neural Networks MIT Press 3 Northrop R B 2000 Introduction to Dynamic Modeling of Neuro Sensory Systems CRC Press
38. output object 8 2 3 Outputs Output Name Description CheckMessage A string containing the error condition of the object OK for no error situation CheckF lag An integer for associated condition 1 for no error situation Chapter 9 BNN Model This chapter contains the description of the BNN model Every BNN model must has the following components 1 2 An Architecture model object A Neuron model object A Synapse model object An Adaptation model object A Simulation model object An Input Output model object 9 1 NEWBNN Function This is the main function for custom BNN model definition 9 1 1 Syntax net newbnn NetArch NeuronModel SynapseModel AdaptModel SimParam IOMode 9 1 NEWBNN Function 51 9 1 2 Input Arguments Input Name Description Net Arch Architecture model object Default is a de fault architecture object NeuronModel Neuron model object Default is a default neuron object SynapseModel Synapse model object Default is a default synapse object AdaptModel Adaptation model object Default is a de fault adaptation object SimParam Simulation model object Default is a default simulation object IOMode Input Output model object Default is a de fault input output object 9 1 3 Output Object The output object is a structure variable containing the fields listed below Field Name Description Architecture Architecture model Neurons Neuron model
39. provide static or dynamic external inputs to the network Static inputs do not change over the simulation process of the model but dynamic inputs may change according to the time or system state variables e During the simulation process it is possible to call some user defined func tions for specific tasks not included in the toolbox 1 2 Overview and Features 5 Stop conditions for the simulation are very flexible The default condition is the simulation time limitation but one can define a special function for this reason Some illustrative examples are included in the toolbox for users to explain how to write their code for simulating specific models Users can change these examples according to their own purposes to obtain a fast code gen eration system Since this is the first release it contains the basic concepts about how this toolbox would be in future releases As mentioned earlier the author would be very grateful for any kind of words from users to keep this toolbox better and alive in next versions You can help the development process by providing comments suggesting new models reporting bugs and anything you think about this toolbox The following list is the features to be added to the toolbox in the next releases 1 2 2 Future Outlook Next releases will have a very user friendly GUI to improve the model cre ation and simulation processes Because of time considerations this feature is not present in this rel
40. r of this table whenever you try to load other parameters into the model 4 6 NEWNEURONCANON Function 31 doa 4 4 gK 8 gL 2 Eca 120mV Ex 84mV E 60mV v 1 2 va 18 v3 2 v4 30 yp 0 04 4 5 1 Syntax NeuronModel newneuronml model_param spike_det_fun_param 4 5 2 Input Arguments Input Name Description model_param Parameters for the model Enter def for default values spike_det_fun_param Parameters for the spike detection function Enter def for default values 4 5 3 Output Object The same as NEWNEURON 4 5 4 Examples 1 A ML model with default parameters and threshold value of 30mV NeuronModel newneuronml def 30 4 6 NEWNEURONCANON Function This function creates a canonical phase neuron model with following equations ae dt There is no adjustable parameter for this model Spike detection is described by 1 cos p 1 cos p I 4 17 if p gt mr then t t 4 18 4 6 1 Syntax NeuronModel newneuroncanon 4 7 NEWNEURONIZ Function 32 4 6 2 Input Arguments No input argument 4 6 3 Output Object The same as NEWNEURON 4 6 4 Examples 1 A canonical phase model NeuronModel newneuroncanon 4 7 NEWNEURONIZ Function This function creates an Izhikevich neuron model with following equations d 0 042 5v 140 u 1 4 19 U d a bv u 4 20 Spike detection and after spike reset is des
41. re and variables in the workspace If you don t want to lose 2 1 Components of a BNN 9 these information comment these lines with inserting at the beginning of the commands 2 1 1 Architecture The first step in creating a BNN model is to define the architecture of the system Architecture of a BNN refers to the basic structure and topology of connections in a network of spiking neurons It also defines how the external inputs are connected to the neurons Each connection has two basic parameters synaptic weight and transmission delay Synaptic weight defines the efficiency or the strength of the input to a spe cific neuron from other neurons or external sources The zero value for a synaptic weight is equal to disconnecting the source from a neuron Because of biochemi cal nature of signal transmission in neurons the process of communication has a temporal delay defined by transmission delay of each connection Neurons in CNS are divided into two different types Inhibitory and Excita tory The architecture object also stores the type of each neuron in the network In addition the architecture object enables user to specify the properties of ex ternal inputs to be as spiking and analog stimulation currents The following command defines the network architecture to be a fully connected structure of 3 excitatory neurons with one external analog input current NetArch newarchfc 3 1 1 2 1 2 Neuron Model The next s
42. t AMES A a a T d 49 A a 6 GRE KE OEE GE bL HD BY HEELS 49 BNN Model 50 91 NEWBNN ECON ocres eee AA eH 50 AN ee AH NE ee a wee ee er 50 o s e ok a4 WH He ee ee ee Bw 51 91 3 AOU OR ees ea a ee rasa a eae oe ed 51 Oia Pee y lt a a a A 51 9 2 CHECKBNN Function lt se sre ta dora Saree eee a 52 UL IU s at Sate a a8 GOR ee dw ae Bed 52 O22 np Arwen irc ci n A A R i 52 igor 61 0 lt a sia RWE Y EER GY ee 52 10 Simulate a BNN 53 10 1 SIMBNN Function 5 cer be eee be 53 DARE a A RR EERE LESSEE SSE AGAR AEN 53 10 1 2 Input Arguments a eee eee eRe ee ees 53 10 1 3 Qutput OIE ok ssa eee ew eK gora ki A 53 Mia Maile oscar aa ra 53 CONTENTS 11 Tools 11 1 GETSTATES Function ILLA Dyes ase 9 K 11 1 2 Input Arguments 11 1 3 Output Object se 11 1 4 Examples 11 2 GETSPIKES Function A AA 11 2 2 Input Arguments 11 2 3 Output Object 11 2 4 Examples 11 3 GETTIME Function 11 3 1 Syntax 22 se a es 11 3 2 Input Arguments 11 3 3 Output Object 11 34 Examples es os 11 4 PLOTSTATES Function MAL Bye oo ee R 11 4 2 Input Arguments 11 4 3 Output Object 11 4 4 Examples 11 5 PLOTSPIKES Function 1154 SM o ees 11 5 2 Input Arguments 11 5 3 Output Object lt 2 2 11 5 4 Examples 11 6 PLOTSPIKES2D Function ILOA BUE 2 ea Sees 11 6 2 Input Arguments 11 6 3 Output Object 11 64 Exampl
43. tax NetArch newarchlf neuron_num input_num input type neuron_ type weight type delay_type 3 6 2 Input Arguments The same as NEWARCHFF 3 6 3 Output Object The same as NEWARCH 3 6 4 Examples The same as NEWARCHFF 3 7 CHECKARCH Function 23 37 CHECKARCH Function This function checks an architecture object for errors and returns a message and a flag indicating the condition of the object 3 7 1 Syntax CheckMessage CheckFlag checkarch NetArch 3 7 2 Input Arguments An architecture object 3 7 3 Outputs Output Name _ Description CheckMessage A string containing the error condition of the object OK for no error situation CheckFlag An integer for associated condition 1 for no error situation Chapter 4 Neuron Model This chapter contains the description of the Neuron component and its variants Three essential parts of a neuron model are 1 Differential Equations DEs of the state variables of the model 2 Spike detection procedure 3 Reset procedure Eq 4 1 gives the general and complete structure of a neuron model ax ar F t x I t x 4 1 which x is the state vector F t x is the internal dynamics and t x is the total external or internal dendritic current The last term will be described in next chapter under the general definition of synapse Please refer to chapter 9 for more information about adding custom neuron models to the library and also the structure of f
44. tensive coding Users can create and simulate a huge network of spiking neurons in less than 10 lines of code or even in one line if they give all arguments to the main function using predefined library functions It is also possible to create and add new models to the library easily using template library items provided for this reason Since programming in MATLAB is now very popular users also would have the benefits of other toolboxes to extend their code and models easily The followings are a list of features available in this release 1 2 1 Current Features e Users can create special architectures for their network connections using library tools Current architectures in the library are Fully connected Multilayer feedforward Multilayer feedforward with general feedback Multilayer feedforward with lateral connections Multilayer feedforward with local feedback Cum WwW N RE Any other kind of user defined architecture is also possible Each network connection consists of synaptic weight and transmission delay features Ex ternal inputs to the network can be defined to be either analog currents or time encoded spikes In addition it is possible to restrict each neuron to inhibitory excitatory or hybrid neurons its behavior can change in the simulation process e The spiking neuron models provided in the library are 1 Linear leaky integrate and fire model General Public License 1 2 Overview and Feat
45. tep is to define the model of neurons in the network The basic part of this object is the Differential Equations DEs of the neuron behavior Because all neurons in this toolbox are spiking models it is necessary to define the spike detection also known as threshold or event and reset functions The spike detection function determines when a specific neuron fires a spike according to its state variables The reset function is responsible for the behavior of the neuron right after the transmission of the spike The next line of the example describes the neurons of the BNN to be linear leaky integrate and fire NeuronModel newneuronif 2 1 3 Synapse Model The process of interaction of neurons in the network with each other and also the effect of external spiking inputs on neurons is described by the synapse model 2 1 Components of a BNN 10 Upon receiving a spike from a pre synaptic source a Post Synaptic Potential PSP is triggered on the destination neuron The synapse model consists of functions to describe the PSP behavior The following command creates a synapse model using the default values SynapseModel newsynapse 2 1 4 Adaptation Model Adaptation model is used to describe the plasticity and learning mechanisms available for a specific BNN Synaptic weight transmission delay threshold value and model parameters plasticity functions can be defined using adaptation mech anism The next line described the adapta
46. tion 11 3 4 Examples 1 Get time values time gettime net 11 4 PLOTSTATES Function This function plots solved state values of a particular neuron 11 4 1 Syntax plotstates net neuron_no 11 4 2 Input Arguments Input Name Description net A BNN model after computations neuron_no Neuron number in the network If you want to plot state values for all neurons don t in sert this argument 11 5 PLOTSPIKES Function 57 11 43 Output Object A figure 11 4 4 Examples 1 Plot state values for 2nd neuron plotstates net 2 2 Plot state values for all neurons plotstates net 11 5 PLOTSPIKES Function This function plots spike times of a particular neuron 11 5 1 Syntax plotspikes net neuron_no 11 5 2 Input Arguments Input Name Description net A BNN model after computations neuron no Neuron number in the network If you want to plot spike times for all neurons don t in sert this argument 11 5 3 Output Object A figure 11 5 4 Examples 1 Plot spike times for 2nd neuron plotspikes net 2 11 6 PLOTSPIKES2D Function 58 2 Plot spike times for all neurons plotspikes net 11 6 PLOTSPIKES2D Function This function plots spike times of all neurons with a dot Vertical axis will be the neuron number and horizental axis will be time 11 6 1 Syntax plotspikes2d net 11 6 2 Input Arguments Input Name Description net A BNN model after computations 11
47. tion object with default values AdaptModel newadapt 2 1 5 Simulation Parameters To simulate a BNN properly we have to specify simulation parameters such as start and stop time initial conditions DE solver type user defined custom function and stop function The main simulator program starts the simulation by solving the DEs from the start time and specified initial conditions It stops the solver when a spike is generated and calls adaptation and user defined custom functions Then the simulation starts again This process repeats until some stopping criteria is satisfied such as stop time or user defined stop command In next command we specify stop time to be 20ms and leave other arguments to get default values SimParam newsim 20 2 1 6 Input Output The last component of the BNN model is the Input Output object This module specifies several features of input and output system of BNN such as which values external inputs have at any time saving options and also some storage fields for the simulation results and output spike times For our simulation example we are going to have a 1jA external input current IOMode newiomode none 1 2 2 Summary 11 2 1 7 BNN Model Now we have all the required objects to construct a BNN model The next line of code gathers the previous modules into a single BNN object network newbnn NetArch NeuronModel SynapseModel AdaptModel Sim Param IOMode
48. to default NetArch newarch 10 5 3 2 NEWARCHFC Function 17 3 2 NEWARCHEC Function This function creates a fully connected architecture i e all neurons and inputs are connected together 3 2 1 Syntax NetArch newarchfc neuron num input_num input type neuron_type weight_type delay_type 3 2 NEWARCHFC Function 18 3 2 2 Input Arguments Input Name neuron_num input_num input type neuron type weight_type weight_type Description Number of neurons in the network N Must be an integer Default is a random number between 1 and 11 Number of inputs in the network M Must be an integer Default is a random number between 1 and 11 A vector of size M each element corresponds to one of inputs There are two different types of inputs spiking and analog current For spiking insert 1 and for analog current insert 1 Default is spiking for all inputs A vector of size N each element corresponds to one of neurons There are three differ ent types of neurons excitatory inhibitory and hybrid can be both excitatory and in hibitory at the same time For excitatory insert 1 for inhibitory insert 1 and for hybrid insert 0 Default is randomly chosen excitatory inhibitory neurons A string indicating how to initialize the weight matrixes random for a random uni form distribution normal for a random nor mal distribution one for all weights equal to 1 and z
49. to detect the spike generation event we added a threshold function to this model The default value for this threshold is 0 8 Default values for model parameters are listed bellow Note that you must preserve the order of this table whenever you try to load other parameters into the model a 0 1 e 0 01 7 0 5 4 4 1 Syntax NeuronModel newneuronfn model_param spike_det_fun_param 4 5 NEWNEURONML Function 30 4 4 2 Input Arguments Input Name Description model_param Parameters for the model Enter def for default values spike_det_fun_param Parameters for the spike detection function Enter def for default values 4 4 3 Output Object The same as NEWNEURON 4 4 4 Examples 1 A FN model with following parameters a 0 05 e 0 02 y 0 6 NeuronModel newneuronfn 0 05 0 02 0 6 45 NEWNEURONML Function This function creates a Morris Lecar ML neuron model with following equa tions T geMolv u Eca grwlu Ex grlu Br 104 12 a a w 4 13 molv 0 5 1 Han 4 14 welv O 5 1 Han 4 15 Tw v a 4 16 Like HH model original ML model does not have any spike detection and reset function But because the simulator program has to detect the spike generation event we added a threshold function to this model The default value for this threshold is 40mV Default values for model parameters are listed bellow Note that you must preserve the orde
50. unction name for internal PSP Internal IntPSPFunParam Parameters for internal PSP function 5 1 4 Examples 1 A synapse model with following properties external PSP is delta func tion with ValidPeriod Imsec internal PSP is a fucntion2 with Ts 20msec Tm l0msec SynapseModel newsynapse delta_fun_ext 1 alpha_fun_int 20 10 52 CHECKSYNAPSE Function This function checks a synapse object for errors and returns a message and a flag indicating the condition of the object 5 2 1 Syntax CheckMessage CheckFlag checksynapse SynapseModel 5 2 2 Input Arguments A synapse object 5 2 3 Outputs Output Name _ Description CheckMessage A string containing the error condition of the object OK for no error situation CheckFlag An integer for associated condition 1 for no error situation Chapter 6 Adaptation Model This chapter contains the description of the Adaptation component Four essen tial parts of a adaptation model are 1 Synaptic weight adaptation mechanism 2 Transmission delay adaptation mechanism 3 Threshold adaptation mechanism 4 Model parameters adaptation mechanism Since this is the first release there is no adaptation model in the library and adaptation items will be added in next release Please refer to chapter 9 for more information about adding custom adaptation models to the library and also the structure of functions This chapter continues with descripti
51. unctions This chapter continues with description of basic neuron component and library items available for this version 4 1 NEWNEURON Function This is the main function for custom neuron model component definition 4 1 1 Syntax NeuronModel newneuron neuron fun model_type state num model_param spike_det_fun spike_det_fun_param reset_fun reset_fun_param 4 1 NEWNEURON Function 25 4 1 2 Input Arguments Input Name neuron fun model_type state_num model_param spike_det_fun spike_det_fun_param reset _fun reset_fun_param Description Function name containing neuron s DEs Must be a string Default value is int fire lin linear integrate and fire neu ron Model type Always must be CDE for this version Default value is CDE Number of state variables in the DEs De fault is 1 Parameters for the model Must be a vector Enter def for default values Function name for spike detection algorithm Default value is threshold_fun Parameters for the spike detection function Enter def for default values Function name for reset algorithm Enter none if there is no need for reset Default value is reset_fun Parameters for the reset function Enter def for default values 4 1 3 Output Object The output object is a structure variable containing the fields listed below All of other neuron functions use this structure as output argu
52. ures 4 Nonlinear quadratic integrate and fire model Hodgkin Huxley model FitzHugh Nagumo model Morris Lecar model Canonical phase model Izhikevich model Users can define other special neuron models easily It is also possible to define different functions for threshold and reset behavior of a neuron if needed e Some predefined Post Synaptic Potential PSP behavior is available in the library 1 Two different versions of a function 2 Simple synaptic weight summation for spike inputs Again user defined synapses are possible e Users can define adaptation mechanisms for synaptic weights transmis sion delays and spike detection thresholds and any other parameter in the network e The simulation process of the network is based on a event driven system meaning that the simulation stops for special computations such as calling reset or adaptation functions whenever an action potential is generated in the network As a result the simulation speed depends highly on the rate of the spike generation rather than complexity of the models or the number of neurons in the network e For neuron models based on differential equations simulation system uses MATLAB s powerful ODE solvers Users have the chance to select various solvers provided for stiff and non stiff problems For continuous time equa tion models such as SRM a special function will be written to solve the model in next release e It is possible to
53. ween 1 and 11 Number of inputs in the network M Must be an integer Default is a random number between 1 and 11 A vector of size M each element corresponds to one of inputs There are two different types of inputs spiking and analog current For spiking insert 1 and for analog current insert 1 Default is spiking for all inputs A vector of size N total number of neurons in layers each element corresponds to one of neurons There are three different types of neurons excitatory inhibitory and hy brid can be both excitatory and inhibitory at the same time For excitatory insert 1 for inhibitory insert 1 and for hybrid in sert 0 Default is randomly chosen excita tory inhibitory neurons A string indicating how to initialize the weight matrixes random for a random uni form distribution normal for a random nor mal distribution one for all weights equal to 1 and zero for all weights equal to zero Default is random A string indicating how to initialize the de lay matrixes random for a random uniform distribution one for all delays equal to 1 and zero for all delays equal to zero De fault is zero 3 4 NEWARCHGF Function 21 3 3 3 Output Object The same as NEWARCH 3 3 4 Examples 1 A feedforward network architecture with following properties 3 layer with 1 excitatory and 2 inhibitory in layer 1 4 excitatory in layer 2 and 2 hybrid in layer

Download Pdf Manuals

image

Related Search

Related Contents

Prereq - Image Types  Brennenstuhl 1178560120 energy-saving lamp  Bedienungsanleitung FUTURA  Die SIPROTEC-Geräte - Siemens Power Solutions  JVC TK-C1460B User's Manual  Mode d`emploi  520026 - Viqua Vending Manual.fm  Compteur/décompteur Enda EC442  LET-22307-LD9  Saeco Saeco Poemia  

Copyright © All rights reserved.
Failed to retrieve file