#] #] ********************* #] "$d_MindCode"'15_MindCode operator explain.txt" # www.BillHowell.ca 29Mar2020 initial # based on "$d_MindCode""2_MindCode [data, optr]s.txt" # [not all globals, few locals] are included # This is manually updated, as special comments are added. # May be problematic to update with new [expr, optr, tran, etc]s .... 17Nov2023 copied d_Qndfs: from d_MindCode (2020) to d_Mind2023 ********************************** *********************************** see bash "$d_bin""MindCode [data, optr]s.sh" - res ipsa loquitor To search for a [variable, optr, etc] : $ mvar="sensL" $ find "$d_MindCode" -type f -name "*.ndf" | tr \\n \\0 | xargs -0 -ILINE grep --with-filename "$mvar" LINE | sed 's|'"$d_MindCode"'||;s/.*#>//' ******************************************************* link d_QNial_mine 'MindCode/globals initialize.ndf' initGlobals IS - initialise global variables ******************************************************* link d_QNial_mine 'MindCode/MLP - multi-layered perceptron.ndf' *** classical NNs perceptron IS OP neuronID - classical continuous neuron, inNets=(synaps, weight) MLP_backprop IS OP netID - basic feedforward MLP training algorithm MLP_orderiv IS OP netID - solid MLP training algorithm ******************************************************* link d_QNial_mine 'MindCode/bits to-from [intg, real].ndf' integers - currently 8 neuron spike patterns (8 bits = byte, signed so -127 <= intg <= 127) bits_to_intg IS OP bitWidth bits - bitWidth pattern to integer number, high bit on -> negative spikes_to_intg IS OP fire - [s2i], for final output: spike pattern to integer number intg_to_bits IS OP intg_in - integer number to bitWidth code, first bit is sign (+-1) intg_to_spikes IS OP intg_in - [i2s], integer number to 8 neuron spike pattern real numbers - bits_to_real IS OP bits - spikes_to_real IS OP spikes - [s2r], spike pattern to real number real_to_bits IS OP real - real number to bitCode real_to_spikes IS OP real netID - [r2s], integer number to 8 neuron spike pattern ******************************************************* link d_QNial_mine 'MindCode/code test/index tests.ndf' integers_test IS - test correctness of results using known results ******************************************************* link d_QNial_mine 'MindCode/code test/fire tests.ndf' fire_test IS - tests to see if "fire" operator works as expected ******************************************************* link d_QNial_mine 'MindCode/code test/MLP tests.ndf' *** net - column descriptions, tables are split up for ease of [view, edit]ing etc ****** net sensory (inputs) and motor controls (outputs) intgConstNetIDL - netIDs for integer constant sensory inputs to net realConstNetIDL - netIDs for real constant sensory inputs to net inConstantL - sequence expressions for sensory inputs ****** net_struct IS - very simple example net 04Mar2020 ontogeny not yet developed - this is it! Hox genes etc later?) 'netIDL' - an ordered "count" of integers starting with zero, i.e. [0 1 2 3 4 5 6 ...] 'inNetL' - a list of inputNets for each netID 'outTypL' - [boolean, integer, real, other, mixed] output, "other" types to be defined as required 'optrL' - name of the operator expressed as a string, operator ~[function, procedure] 'offTL' - the refractory period for a net, varies with its complexity and component nets 'waitTL' - timeSteps until the net will become active again, "0" for a net that can be fired now 'wghtL' - weight list, required for some of the classical (non-epi-DNA) neurons ****** for the future? 'fieldL' - local field variations indicative of neural activity (classical measures) 'glial' - glial cell role in brain computations, if any 'solarL' - This [name, symbol] is purposely anomalous, to prevent myopic thinking ****** net_morphFlip IS - [morph, flip]ing parameters 'modL' - neuromodulator state [dopamine, serotonin, noradrenaline, acetocholine] 'wghtL' - weight list, required for classical (non-epi-DNA) neurons ****** net_triggers - 'trigTypeL' : 'trigPatL' (apply trigTypeL) inHistL@netID 'now' - no history, just nowFireL (= cull sort (second inHistL@netID)) 'cum' - [order, timing] not important (= cull sort link (rest inHistL@netID)) 'seq' - sequence important, but not timing ( link (rest inHistL@netID)) 'tim' - [sequence, timing] are important! ( = (rest inHistL@netID)) 'mix' - mixture of other trigTyps (special - need examples) 05Mar2020 - I need some kind of [error, noise] tolerance 'trigPatL' - fire on pattern match, this can be [generic, specific to a net] 'inHistL' - firing inputs over last (gage shape inHistL@netID) timesteps, MUST be >= 2 (nowFire & oldFire) netIDs pass general data (NOT just a single spike), which can be used in triggers ****** net_results IS - very simple example net 'fireL' - fire state of the net output, expressed as spikes (booleans) 'StdL' - "standard" result (presumably correct result for comparison against ResL) 'ResL' - results at current time step 'OKL' - check if net produced target result ('StdL' = 'ResL') ******************************************************* link d_QNial_mine 'MindCode/code test/trig [now, cum, seq, tim, mix] tests.ndf' notes trig_test IS - test correctness of results, no history, just nowFireL ******************************************************* link d_QNial_mine 'MindCode/code test/convert [bits, intg, real] tests.ndf' integers_test IS - test correctness of results using known results reals_test IS - test correctness of results using known results ******************************************************* link d_QNial_mine 'MindCode/net constructors.ndf' net construction - reduces [error, time] of hand coding (later - separate files for MLPs etc) net_construct IS OP net_specs - build code for net based on net_specs memory - storage of spiking patterns, must address [short, long] term (06Mar2020 - 'histPatL' is all I have) ******************************************************* link d_QNial_mine 'MindCode/code test/control structures.ndf' *** Control structures if_exprn_Z80 IS OP netID strtNetID endNetID ifNetID for_loop_Z80 IS OP netID strtNetID endNetID sequenceID while_loop_Z80 IS OP netID strtNetID endNetID sequenceID ******************************************************* link d_QNial_mine 'MindCode/MindCode basics.ndf' standard basic trigger patterns [now, cum, seq, tim]Trig netIDs pass general data (NOT just a single spike), which can be used in triggers nowTrig IS OP trigPat histPat - no history, just (first lastFireL) cumTrig IS OP trigPat histPat - [order, timing] not important seqTrig IS OP trigPat histPat - sequence important, but not timing timTrig IS OP trigPat histPat - [sequence, timing] are important! mixTrig IS OP trigPat histPat - mixture of other trigTyps (each case is special, separate oprtr) view MindCode global [network, cols] table_write IS OP titles - view_MindCode IS - view the netMindCode state view_cycle IS - view key variables at each MindCode cycle build MindCode global [network, cols] local_to_global_cols IS - based on all sub_nets loadded, adapt local-to-global indexing nmID_to_stdID IS OP nmID - given the nmID=[stdNameL, stdSubIDL], find the stdID stdInOutTrig IS - build stdOutL list of (each net [input, output, trigPat] connections) nmID_to_stdID IS - find the stdID for a [name, subID] combination stndNet_build IS - add n_cols of of "standard" cnstNet data to corresponding globalCols of MindCode fire netID fire IS OP netID - fire netID (of lastFireL nets), using its optr MindCode_[stop, cycle, load] MindCode_stop IS - output the final results MindCode_cycle IS - fire appropriate neurons, then update the net MindCode_load IS - load all sub-nets proceed to run netMindCode ; ******************************************************* link d_QNial_mine 'MindCode/arith, trig examples.ndf' *** intg00 - [example, test] integer network setup *** real00 - [example, test] real network setup Code tests - these should be lauched from 'MindCode/MindCode basics.ndf' tests IS - standard checks that operators function as expected ******************************************************* link d_QNial_mine 'MindCode/Z80 operator listing.ndf' *** Usage via fire_apply (see "MindCode basics.ndf") fire IS OP netID - fire netID (of nowFireL nets), using its optr *** Logic operators 'and' 'or' 'not' '=' ['~=', 'unequal'] 'diverse' *** Comparison operators (boolean) ['>' , 'gt' ] ['>=' , 'gte'] ['<' , 'lt' ] ['<=' , 'lte'] 'match' 'mate' 'max' 'min' 'up' *** Types operators (boolean), for atomic types 'isboolean' 'ischar' 'isfault' 'isinteger' 'isphrase' 'isreal' 'isstring' *** Arithmetic operators, [integer,real] [inputs, output] where Xxx = [Z80, Pat, ...] Pat = pattern, [unary, binary, multi] pervasive ['sumXxx'] - multi, ['productXxx'] - multi, 'timesXxx' - binary, 'divideXxx'] - binary, 'opp' - pair, produce the negative (* -1) of the single input to netID '*' - multiply inputs of ALL preNetIDs 'recip' - produce the reciprocal (1 /) of the SINGLE input to netID 'exp' - produce the exponent (e^) of the SINGLE input to netID 'ln' - produce the natural logarithm (ln) of the SINGLE input to netID ['^', 'power'] - inNets = [baseNet, exptNet] in that order, raise baseNet to the power *** Trigonometric operators require real inputs 'sin' 'cos' 'tan' 'cosh' 'tanh' 'arcsin' 'arccos' 'arctan' 'arcsinh' 'arccosh' 'arctanh' *** NN-specific basics - sigmoidal, counter, timer, concept neuron 'count' timer IS OP timerNetID - ['dotProdxxx', 'INNER [+, *]'] IS - produces the inner (dot) product of two arrays of arbitrary dimension ******************************************************* link d_QNial_mine 'MindCode/code test/data types.ndf' initialize [data types, global variables] setup_8bit IS - currently 8 neuron spike patterns (8 bits = byte, signed) power_series IS OP bitWidth - produce a power series for conversion of bits to [intg, real, etc] xargs: grep: terminated by signal 13 # enddoc