Exemple #1
0
 def activate(self):
     " Updates neuron's state for a single time-step. "
     if(len(self._synapses) > 0):            
         self.__update_state()
         return nn.sigmoid(self.__state + self._bias, self._response, self._activation_type)
     else:
         return self._output # in case it's a sensor
Exemple #2
0
    def __init__(self, neurontype, id = None, bias = 0.0, response = 1.0, activation_type = 'exp', tau = 1.0):
        super(CTNeuron, self).__init__(neurontype, id, bias, response, activation_type)

        # decay rate
        self.__tau  = tau 
        # needs to set the initial state (initial condition for the ODE)
        self.__state = 0.1 #TODO: Verify what's the "best" initial state
        # fist output
        self._output = nn.sigmoid(self.__state + self._bias, self._response, self._activation_type)
        # integration step
        self.__dt = 0.05 # depending on the tau constant, the integration step must 
Exemple #3
0
    def __init__(self,
                 neurontype,
                 id=None,
                 bias=0.0,
                 response=1.0,
                 activation_type='exp',
                 tau=1.0):
        super(CTNeuron, self).__init__(neurontype, id, bias, response,
                                       activation_type)

        # decay rate
        self.__tau = tau
        # needs to set the initial state (initial condition for the ODE)
        self.__state = 0.1  #TODO: Verify what's the "best" initial state
        # fist output
        self._output = nn.sigmoid(self.__state + self._bias, self._response,
                                  self._activation_type)
        # integration step
        self.__dt = 0.05  # depending on the tau constant, the integration step must
Exemple #4
0
 def set_init_state(self, state):
     self.__state = state
     self._output = nn.sigmoid(self.__state + self._bias, self._response, self._activation_type)
Exemple #5
0
 def activate(self):
     """ Updates neuron's state for a single time-step. . """
     assert self._type is not 'INPUT'
     self.__update_state()
     return nn.sigmoid(self.__state + self._bias, self._response,
                       self._activation_type)
Exemple #6
0
 def set_init_state(self, state):
     self.__state = state
     self._output = nn.sigmoid(self.__state + self._bias, self._response,
                               self._activation_type)
Exemple #7
0
 def activate(self):
     """ Updates neuron's state for a single time-step. . """
     assert self._type is not 'INPUT'
     self.__update_state()
     return nn.sigmoid(self.__state + self._bias, self._response, self._activation_type)