示例#1
0
文件: ctrnn.py 项目: alexmsimms/bees
 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
示例#2
0
文件: ctrnn.py 项目: alexmsimms/bees
    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 
示例#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
示例#4
0
文件: ctrnn.py 项目: alexmsimms/bees
 def set_init_state(self, state):
     self.__state = state
     self._output = nn.sigmoid(self.__state + self._bias, self._response, self._activation_type)
示例#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)
示例#6
0
 def set_init_state(self, state):
     self.__state = state
     self._output = nn.sigmoid(self.__state + self._bias, self._response,
                               self._activation_type)
示例#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)