Exemplo n.º 1
0
def rootNeuronNode():
  node = NeuronNode(None, None, True, defaultNeuronTransform(), defaultNeuronTransform())
  node.tree = NeuronTree(node, emptyMutationRates((Neurons.divisionDataSize)), \
      emptyMutationRates((2, Neurons.divisionDataSize)))
  return node
Exemplo n.º 2
0
      if (random.random() < tree.otherRates[11]):
        child.setSymmetric(True)
    
    return child
  
  def setSymmetric(self, symmetric):
    self.symmetric = symmetric
    if (not self.complete):
      self.left.setSymmetric(symmetric)
      self.right.setSymmetric(symmetric)
  
  def copy(self):
    return SynapseNode(self.left, self.right, self.complete, self.leftTransform, self.rightTransform, \
                       self.sourceCarries, self.sinkCarries, self.symmetric)

leafNeuronNode = NeuronNode(None, None, True, defaultNeuronTransform(), defaultNeuronTransform())

leafSynapseNode = SynapseNode(None, None, True, defaultSynapseTransform(), defaultSynapseTransform())

def rootNeuronNode():
  node = NeuronNode(None, None, True, defaultNeuronTransform(), defaultNeuronTransform())
  node.tree = NeuronTree(node, emptyMutationRates((Neurons.divisionDataSize)), \
      emptyMutationRates((2, Neurons.divisionDataSize)))
  return node

def inputTree():
  return NeuronTree(None, emptyMutationRates((Neurons.inputDivisionDataSize)), \
      emptyMutationRates((2, Neurons.inputDivisionDataSize)))

def rootSynapseNode():###symmetric shouldn't be True
  node = SynapseNode(None, None, True, defaultSynapseTransform(), defaultSynapseTransform())