#] #] ********************* #] loaddefs link d_MindCode 'basics - clusters.ndf' - optrs to [create, connect, test] various cluster types # www.BillHowell.ca 03Aug2021 split off from 'basics - neurons, clusters.ndf' (10Sep2020 initial) # approaches to symbolic representation in MindCode # "multiple conflicting hypothesis" # see also "$d_MindCode""neurons/logic gates.ndf" # view this file in a text editor, with [constant width font, tab = 3 spaces], no line-wrap # WARNING!!! section "initialize global variables" in d_MindCode 'globals initialize.ndf' # is NOT the same!!! f_clusters := 'basics - clusters.ndf' ; loaddefs_start f_clusters ; #**************************** # List of operators, generated with : # $ grep "^#]" "$d_Qndfs""MindCode/basics - clusters.ndf" | sed 's/^#\]/ /' # ********************* loaddefs link d_MindCode 'basics - clusters.ndf' - optrs to [create, connect, test] various neuron types Initialize globals +-----+ clusters clusSize_increment - expand the list (including non-assigned) of clusters clusIdent_get - get clusIdent for new cluster, increment the lastClusterPointer clus_create IS OP classPhr - generic optr for adding clusters clusNeurs_create IS OP n_neurons - create neurons for a cluster #08********08 # Quick explanations # Base tools for MindCode - [0,1,2,3,burst] spiking, http://www.scholarpedia.org/article/Bursting Bursts encode different features of sensory input than single spikes (Gabbiani et al. 1996, Oswald et al. 2004). For example, neurons in the electrosensory lateral-line lobe (ELL) of weakly electric fish fire network induced-bursts in response to communication signals and single spikes in response to prey signals (Doiron et al. 2003). # 0-spiking = non-spiking neurons https://en.wikipedia.org/wiki/Non-spiking_neuron Through studying these complex spiking networks in animals, a neuron that did not exhibit characteristic spiking behavior was discovered. These neurons use a graded potential to transmit data as they lack the membrane potential that spiking neurons possess. #08********08 #] +-----+ #] Initialize globals clusList_increment := 100 ; % maximum number of clusters (array size initial - can be increased) ; n_clus := 100 ; clus_last := -1 ; % points to last-created cluster ; nullList := clusList_increment reshape [null] ; clusIdentL := nullList ; clusClassL := nullList ; % clusClass is a PHRASE!! ; clusNeurnL := nullList ; #08********08 #] +-----+ #] clusters # cluster of [cluster,neuron]s -> may need [super-cluster, system]s etc? probably redundant? # treats conections as bundles of neurons, with connections to other clusters ?and individual neurons? # some neurons are "captive" with connections ONLY within the cluster # other neurons connect to external [cluster, neuron]s # servers as a "state" machine [receive, hold, send]ing an integer value # initial neuron states = 0 # intra-cluster connections : NONE initially, added by connect optrs IF flag_debug THEN write '+-----+' ; ENDIF ; IF flag_debug THEN write 'Cluster primitives' ; ENDIF ; IF flag_debug THEN write 'loading clusDisplay' ; ENDIF ; #] clusDisplay IS OP clusIdentStart clusIdentEnd - show a range of cluson typeValues clusDisplay IS OP clusIdentStart clusIdentEnd { LOCAL iList ; NONLOCAL clusIdentL clusClassL clusNeurnL ; iList := clusIdentStart + (tell (clusIdentEnd - clusIdentStart)) ; transpose mix (iList EACHRIGHT choose clusIdentL clusClassL clusNeurnL) } # for full list of defined clusters : clusDisplay 0 clus_last # for first 10 : clusDisplay 0 10 IF flag_debug THEN write 'loading clusNeurDisplay' ; ENDIF ; #] clusNeurDisplay IS OP clusIdentStart clusIdentEnd - show a range of cluson typeValues clusNeurDisplay IS OP clusIdent { LOCAL iList ; NONLOCAL neurIdentL neurClassL dendIdentL dendDelayL dendInhibL axonIdentL axonDelayL axonInhibL ; transpose mix (clusNeurnL@clusIdent EACHRIGHT choose neurIdentL neurClassL dendIdentL dendDelayL dendInhibL axonIdentL axonDelayL axonInhibL) } IF flag_debug THEN write 'loading clusSize_increment' ; ENDIF ; #] clusSize_increment - expand the list (including non-assigned) of clusters clusSize_increment IS { NONLOCAL n_clus clusList_increment clusIdentL clusClassL clusNeurnL ; nullList := clusList_increment reshape null ; clusIdentL := clusIdentL link nullList ; clusClassL := clusClassL link nullList ; clusNeurnL := clusNeurnL link nullList ; n_clus := n_clus + clusList_increment ; } IF flag_debug THEN write 'loading clusIdent_get' ; ENDIF ; #] clusIdent_get - get clusIdent for new cluster, increment the lastClusterPointer clusIdent_get IS { NONLOCAL n_clus clus_last clusIdentL ; clus_last := clus_last + 1 ; IF (n_clus = clus_last) THEN clusSize_increment ; ENDIF ; update "clusIdentL clus_last clus_last ; clus_last } IF flag_debug THEN write 'loading clus_create' ; ENDIF ; #] clus_create IS OP classPhr - generic optr for adding clusters # 03Apr2021 initial clus_create IS OP classPhr { LOCAL errmsg clusIdent ; NONLOCAL clusIdentL clusClassL ; clusIdent := clusIdent_get ; update "clusClassL clusIdent classPhr ; clusIdent } # loaddefs link d_MindCode 'basics - clusters.ndf' IF flag_debug THEN write 'loading clusNeurs_create' ; ENDIF ; #] clusNeurs_create IS OP clusIdent n_neurons - create neurons for a cluster # 03Apr2021 initial clusNeurs_create IS OP clusIdent n_neurons { LOCAL clusNeurns i ; NONLOCAL clusNeurnL ; IF flag_break THEN BREAK ; ENDIF ; clusNeurns := null ; FOR i WITH (tell n_neurons) DO clusNeurns := clusNeurns link (neur_create "unknown) ; ENDFOR ; update "clusNeurnL clusIdent clusNeurns ; clusNeurns } #08********08 #] +-----+ #] basic cluster tools IF flag_debug THEN write '+-----+' ; ENDIF ; IF flag_debug THEN write 'basic tools' ; ENDIF ; # loaddefs link d_MindCode 'basics - clusters.ndf' IF flag_debug THEN write 'loading tblLookUp' ; ENDIF ; #] tblLookUp IS OP tblCols inns - lookup table fudge instead of defining neuron connections within cluster # 09Aug2021 initial IF flag_break THEN BREAK ; ENDIF ; tblLookUp IS OP tblCols inns { (find_Howell inns tblCols@1) pick tblCols@2 } #08********08 #] +-----+ #] examples IF flag_debug THEN write '+-----+' ; ENDIF ; IF flag_debug THEN write 'examples' ; ENDIF ; # neurIdent0 := neur_create ; neurIdent1 := neur_create ; neurIdent2 := neur_create ; # loaddefs link d_MindCode 'basics - clusters.ndf' loaddefs_ended f_clusters ; # enddoc