コード例 #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
ファイル: ctrnn_pure.py プロジェクト: davidmfinol/py3NEAT
    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
ファイル: ctrnn_pure.py プロジェクト: davidmfinol/py3NEAT
 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
ファイル: ctrnn_pure.py プロジェクト: davidmfinol/py3NEAT
 def set_init_state(self, state):
     self.__state = state
     self._output = nn.sigmoid(self.__state + self._bias, self._response,
                               self._activation_type)
コード例 #7
0
ファイル: ctrnn.py プロジェクト: ElliotGluck/neat-python
 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)