- Timestamp:
- 12/16/11 21:35:18 (13 years ago)
- Location:
- cpp/gdk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/gdk/neuroimpl.cpp
r69 r72 5 5 #include "neuroimpl.h" 6 6 #include "neurofactory.h" 7 #include "rndutil.h" 7 8 #ifndef GDK_WITHOUT_FRAMS 8 9 #include "creature.h" … … 22 23 static ParamEntry nncfg_paramtab[]= 23 24 { 24 {"Creature: Neurons",1,2,"nnsim",}, 25 {"randinit",1,0,"Random initialization","f 0 10 0.01",FIELD(randominit),"Allowed range for initializing all neuron states with uniform distribution random numbers and zero mean. Set 0 for deterministic initialization."}, 25 {"Creature: Neurons",1,3,"nnsim",}, 26 {"randinit",1,0,"Random initialization","f 0 10 0.01",FIELD(randominit),"Allowed range for initializing all neuron states with uniform distribution random numbers and zero mean. Set to 0 for deterministic initialization."}, 27 {"nnoise",1,0,"Noise","f 0 1 0",FIELD(nnoise),"Gaussian neural noise: a random value is added to each neural output in each simulation step. Set standard deviation here to add random noise, or 0 for deterministic simulation."}, 26 28 {"touchrange",1,0,"T receptor range","f 0 100 1",FIELD(touchrange),}, 27 29 {0,0,0,}, … … 32 34 :par(nncfg_paramtab,this), 33 35 randominit(0.01), 36 nnoise(0), 34 37 touchrange(1) 35 38 {} … … 197 200 chstate=chnewstate; 198 201 neuro->state=newstate; 202 if (NeuroNetConfig::globalconfig.nnoise>0.0) 203 { 204 neuro->state+=RndGen.GaussStd()*NeuroNetConfig::globalconfig.nnoise; 205 if (channels>1) 206 for(int i=0;i<chstate.size();i++) 207 chstate(0)+=RndGen.GaussStd()*NeuroNetConfig::globalconfig.nnoise; 208 } 199 209 } 200 210 } … … 290 300 {"getInputStateChannel",0,0,"Get input signal from channel","p f(d input,d channel)",PROCEDURE(p_getchan),}, 291 301 {"getWeightedInputStateChannel",0,0,"Get weighted input signal from channel","p f(d input,d channel)",PROCEDURE(p_getwchan),}, 292 {"state",0,0,"Neuron state (channel 0)","f",GETSET(state),"When read, returns the current neuron state.\nWhen written, sets the next neuron state (for use in the neuron definition)"},302 {"state",0,0,"Neuron state (channel 0)","f",GETSET(state),"When read, returns the current neuron state.\nWhen written, sets the 'internal' neuron state that will become current in the next step.\nTypically you should use this field, and not currState."}, 293 303 {"channelCount",0,0,"Number of output channels","d",GETSET(channels),}, 294 {"getStateChannel",0,0,"Get outputstate for channel","p f(d channel)",PROCEDURE(p_getstate),},295 {"setStateChannel",0,0,"Set outputstate for channel","p(d channel,f value)",PROCEDURE(p_setstate),},304 {"getStateChannel",0,0,"Get state for channel","p f(d channel)",PROCEDURE(p_getstate),}, 305 {"setStateChannel",0,0,"Set state for channel","p(d channel,f value)",PROCEDURE(p_setstate),}, 296 306 {"hold",0,0,"Hold state","d 0 1",GETSET(hold),"\"Holding\" means keeping the neuron state as is, blocking the regular neuron operation. This is useful when your script needs to inject some control signals into the NN. Without \"holding\", live neurons would be constantly overwriting your changes, and the rest of the NN could see inconsistent states, depending on the connections. Setting hold=1 ensures the neuron state will be only set by you, and not by the neuron. The enforced signal value can be set using Neuro.currState before or after setting hold=1. Set hold=0 to resume normal operation.",}, 297 {"currState",0,0," Neuron state (channel 0)","f",GETSET(cstate),"The only difference from the \"state\" field is that currState, when written, changes the internal neuron state immediately (which disturbs the regular synchronous NN operation).This feature should only be used while controlling the neuron 'from outside' (like a neuro probe) and not in the neuron definition. See also: Neuro.hold",},298 {"setCurrStateChannel",0,0,"Set neuronfor channel","p(d channel,f value)",PROCEDURE(p_setcstate),"Analogous to \"currState\"."},307 {"currState",0,0,"Current neuron state (channel 0)","f",GETSET(cstate),"When read, it behaves just like the 'state' field.\nWhen written, changes the current neuron state immediately, which disturbs the regular synchronous NN operation.\nThis feature should only be used while controlling the neuron 'from outside' (like a neuro probe) and not in the neuron definition. See also: Neuro.hold",}, 308 {"setCurrStateChannel",0,0,"Set current neuron state for channel","p(d channel,f value)",PROCEDURE(p_setcstate),"Analogous to \"currState\"."}, 299 309 {"position_x",0,0,"Position x","f",GETONLY(position_x),}, 300 310 {"position_y",0,0,"Position y","f",GETONLY(position_y),}, -
cpp/gdk/neuroimpl.h
r66 r72 28 28 Param par; 29 29 double randominit; 30 double nnoise; 30 31 double touchrange; 31 32
Note: See TracChangeset
for help on using the changeset viewer.