Ejemplo n.º 1
0
 def set(self,value,calc_output=True):
     ArrayNode.set(self,value,calc_output=False)
     if self.mode=='rate':
         if value is None:
             self._set_activity=None            
         else:
             c=self.array_to_current(self._set_array)+self.Jbias
             self._set_activity=self.current_to_activity(c)
     if calc_output: self._calc_output()
Ejemplo n.º 2
0
 def set(self,value,calc_output=True):
     ArrayNode.set(self,value,calc_output=False)
     if self.mode=='rate':
         if value is None:
             self._set_activity=None            
         else:
             c=self.array_to_current(self._set_array)+self.Jbias
             self._set_activity=self.current_to_activity(c)
     if calc_output: self._calc_output()
Ejemplo n.º 3
0
 def _calc_output(self):
     if self.mode!='rate': return ArrayNode._calc_output(self)
     if self._set_activity is not None:
         out=self._set_activity
     else:
         out=self.current_to_activity(self.array_to_current(self.accumulator.value())+self.Jbias)
     if self.apply_noise:
         out=self.add_activation_noise(out)
     self._output=out
Ejemplo n.º 4
0
 def _calc_output(self):
     if self.mode!='rate': return ArrayNode._calc_output(self)
     if self._set_activity is not None:
         out=self._set_activity
     else:
         out=self.current_to_activity(self.array_to_current(self.accumulator.value())+self.Jbias)
     if self.apply_noise:
         out=self.add_activation_noise(out)
     self._output=out
Ejemplo n.º 5
0
 def _calc_output(self):
     if self.mode != 'rate': return ArrayNode._calc_output(self)
     if self._set_activity is not None:
         out = self._set_activity
     elif self._input is not None:
         out = self.current_to_activity(self._input)
     else:
         out = numpy.zeros(self.neurons)
     if self.apply_noise:
         out = self.add_activation_noise(out)
     self._output = out
Ejemplo n.º 6
0
 def array(self):
     if self._array is None:
         if self.mode!='rate': return ArrayNode.array(self)
         self._array=self.activity_to_array(self._output)
     return self._array
Ejemplo n.º 7
0
 def array(self):
     if self._array is None:
         if self.mode!='rate': return ArrayNode.array(self)
         self._array=self.activity_to_array(self._output)
     return self._array
Ejemplo n.º 8
0
 def _clear_inputs(self):
     if self.mode != 'rate': return ArrayNode._clear_inputs(self)
     if self._input is None: self._input = numpy.zeros(self.neurons)
     self._input[:] = self.Jbias