// $Id: afferent_input.g,v 16.1 2000/03/02 14:43:39 ajay Exp $ // genesis // afferent_input.g HIPPO model // Connections from afferent input to pyramidal cell layer. Afferent // cells are pulse generators that provide input to the inject field // of soma compartment of pyr cells. Each spatial pattern consists of // 5 pyr cells being made to spike by afferent input 4 times at 100 Hz. // 15 spatial patterns are presented at 150ms intervals to form a // sequence of patterns. //********************************************************************** // Note: Since random connections between pyr cells are set up at the // startup of simulation, it ought to be OK to pick the same set // of cells everytime as input layer cells. Thus the first 75 pyr cells // [0-74] could be used to represent the 15 spatial patterns of // a sequence, with 5 cells per pattern. This would make it easier // for display purposes. //*********************************************************************** int PatPerSeq = 15 // 15 patterns in a sequence int CellsPerPat = 5 // 5 pyr cells in each spatial pattern // provides aff input to pyr cells [0 to numpat*5-1] function connect_aff(numpat) float xmin = 0 float xmax = {numpat * CellsPerPat} float clear_xmax int i, imes // first clear previous connections between aff cells and pyr cells if any // clear from pyr 0 to max of NPYR or {CellsPerPat * PatPerSeq} if (NPYR <= {CellsPerPat * PatPerSeq}) clear_xmax = NPYR else clear_xmax = {CellsPerPat * PatPerSeq} end for (i = 0; i < {clear_xmax}; i = i+1) imes = {getmsg /pyr_layer/pyr[{i}]/soma -in -find /aff_layer/aff[{i}]/input INJECT} if (imes > 0) // message found deletemsg /pyr_layer/pyr[{i}]/soma {imes} end end echo Connecting afferent input to pyr cell layer ... for (i={xmin}; i<{xmax}; i=i+1) // one-to-one connection between aff and pyr cells addmsg /aff_layer/aff[{i}]/input /pyr_layer/pyr[{i}]/soma \ INJECT output end end //-------------------------------------------------------------------------------------------- // connect_aff_to_ffi connects afferent input (one for each pattern) to feedforward inbitory cell function connect_aff_to_ffi int i int idx echo Connecting afferent input to feedforward inhibitory cell... for (i=0; i<{num_aff_pat}; i=i+1) idx = i * {CellsPerPat}; addmsg /aff_layer/aff[{idx}]/input /ffi_layer/int_a/soma INJECT output end end connect_aff_to_ffi //***************************************************************** // Below are functions that allow pyr cells which code the input // pattern sequence to be chosen at random, rather than preselecting // pyr cells [0-74] as the input layer cells. // A table@D object, "/sequence", stores the selected pyr cells. //***************************************************************** /* create table2D /sequence // stores pyr cell#s comprising sequence // select pyr cells (randomly) to be activated by afferent input function rand_pyr_cells(npyr) int npyr // number of pyr cells used in simulation int xdivs = {PatPerSeq-1} // patterns 0 - 14 of sequence int ydivs = {CellsPerPat-1} // cells 0 - 4 of pattern float xmin = 0 float xmax = {PatPerSeq-1} float ymin = 0 float ymax = {CellsPerPat-1} int i,j int rnum // random number corresponding to pyr cell chosen echo Selecting pyr cells at random for afferent input ... randseed // system clock used for seed, to give diff. starting points call /sequence TABCREATE {xdivs} {xmin} {xmax} {ydivs} {ymin} {ymax} for (i={xmin}; i<={xmax}; i=i+1) for (j={ymin}; j<={ymax}; j=j+1) rnum = {rand 0 {npyr}} setfield /sequence table->table[{i}][{j}] {rnum} end end end rand_pyr_cells {CA3_NX * CA3_NY} // connect aff pulsegens to soma inject of above pyr cells // Note: aff layer was set up to provide 15 patterns with 5 cells/pattern function connect_input // provides aff input to 75 random pyr cells float xmin = 0 float xmax = {PatPerSeq} float ymin = 0 float ymax = {CellsPerPat} int i,j,k int cellnum echo Connecting afferent input to pyr cell layer ... for (i={xmin}; i<{xmax}; i=i+1) for (j={ymin}; j<{ymax}; j=j+1) cellnum = {getfield /sequence table->table[{i}][{j}]} // pyr cell k = i*5 + j // aff cell addmsg /aff_layer/aff[{k}]/input /pyr_layer/pyr[{cellnum}]/soma \ INJECT output end end end connect_input // print out selected sequence function print_sequence int i,j echo Printing pyr cell numbers comprising pattern sequence echo Each row is one spatial pattern. 15 patterns in sequence. for (i=0; itable[{i}][{j}]} -n echo " " -n end echo // newline end end print_sequence // save sequence to file for future ref. function save_sequence(filename) int i,j echo Printing pyr cell numbers comprising pattern sequence echo Each row is one spatial pattern. 15 patterns in sequence. for (i=0; itable[{i}][{j}]} -n >> {filename} echo " " -n >> {filename} end echo >> {filename} // newline end end echo sequence1 > seq_file.asc save_sequence seq_file.asc */