Example #1
0
File: ann.py Project: Hydex/ann
    def setSynapse(self, axon, dendrite, weight):
        axon_id = mutil.extractNeuronId(axon)
        dendrite_id = mutil.extractNeuronId(dendrite)

        #print 'setting synapse from', axon_id, 'to', dendrite_id, 'with weight', weight
        mutil.makeDictIfNot(self.synapses_by_dendrite, dendrite_id)
        mutil.makeDictIfNot(self.synapses_by_axon, axon_id)
        self.synapses_by_dendrite[dendrite_id][axon_id] = weight
        self.synapses_by_axon[axon_id][dendrite_id] = weight
Example #2
0
File: ann.py Project: Hydex/ann
    def setSynapse(self, axon, dendrite, weight):
        axon_id = mutil.extractNeuronId(axon)
        dendrite_id = mutil.extractNeuronId(dendrite)

        #print 'setting synapse from', axon_id, 'to', dendrite_id, 'with weight', weight
        mutil.makeDictIfNot(self.synapses_by_dendrite, dendrite_id)
        mutil.makeDictIfNot(self.synapses_by_axon, axon_id)
        self.synapses_by_dendrite[dendrite_id][axon_id] = weight
        self.synapses_by_axon[axon_id][dendrite_id] = weight
Example #3
0
File: ann.py Project: Hydex/ann
 def weightAtSynapse(self, axon, dendrite):
     axon_id = mutil.extractNeuronId(axon)
     dendrite_id = mutil.extractNeuronId(dendrite)
     return self.synapses_by_axon[axon_id][dendrite_id]
Example #4
0
File: ann.py Project: Hydex/ann
 def getAllSynapsesByAxon(self, axon):
     neuron_id = mutil.extractNeuronId(axon)
     if self.synapses_by_axon.has_key(neuron_id):
         return self.synapses_by_axon[neuron_id]
     #print 'no synapses found'
     return {}
Example #5
0
File: ann.py Project: Hydex/ann
 def getAllSynapsesByDendrite(self, dendrite):
     neuron_id = mutil.extractNeuronId(dendrite)
     if self.synapses_by_dendrite.has_key(neuron_id):
         return self.synapses_by_dendrite[neuron_id]
     #print 'no synapses found'
     return {}
Example #6
0
File: ann.py Project: Hydex/ann
 def setErrorAt(self, neuron, error):
     neuron_id = mutil.extractNeuronId(neuron)
     if self.neurons.has_key(neuron_id):
         #print 'setting error at', neuron_id, 'to', error
         self.neurons[neuron_id].error = error
Example #7
0
File: ann.py Project: Hydex/ann
 def getErrorAt(self, neuron):
     neuron_id = mutil.extractNeuronId(neuron)
     if self.neurons.has_key(neuron_id):
         return self.neurons[neuron_id].error
Example #8
0
File: ann.py Project: Hydex/ann
 def derivativeOutputAt(self, neuron):
     neuron_id = mutil.extractNeuronId(neuron)
     return self.neurons[neuron_id].derivativeOutput()
Example #9
0
File: ann.py Project: Hydex/ann
 def outputAt(self, neuron):
     neuron_id = mutil.extractNeuronId(neuron)
     return self.neurons[neuron_id].output()
Example #10
0
File: ann.py Project: Hydex/ann
 def weightAtSynapse(self, axon, dendrite):
     axon_id = mutil.extractNeuronId(axon)
     dendrite_id = mutil.extractNeuronId(dendrite)
     return self.synapses_by_axon[axon_id][dendrite_id]
Example #11
0
File: ann.py Project: Hydex/ann
 def getAllSynapsesByAxon(self, axon):
     neuron_id = mutil.extractNeuronId(axon)
     if self.synapses_by_axon.has_key(neuron_id):
         return self.synapses_by_axon[neuron_id]
     #print 'no synapses found'
     return {}
Example #12
0
File: ann.py Project: Hydex/ann
 def getAllSynapsesByDendrite(self, dendrite):
     neuron_id = mutil.extractNeuronId(dendrite)
     if self.synapses_by_dendrite.has_key(neuron_id):
         return self.synapses_by_dendrite[neuron_id]
     #print 'no synapses found'
     return {}
Example #13
0
File: ann.py Project: Hydex/ann
 def setErrorAt(self, neuron, error):
     neuron_id = mutil.extractNeuronId(neuron)
     if self.neurons.has_key(neuron_id):
         #print 'setting error at', neuron_id, 'to', error
         self.neurons[neuron_id].error = error
Example #14
0
File: ann.py Project: Hydex/ann
 def getErrorAt(self, neuron):
     neuron_id = mutil.extractNeuronId(neuron)
     if self.neurons.has_key(neuron_id):
         return self.neurons[neuron_id].error
Example #15
0
File: ann.py Project: Hydex/ann
 def derivativeOutputAt(self, neuron):
     neuron_id = mutil.extractNeuronId(neuron)
     return self.neurons[neuron_id].derivativeOutput()
Example #16
0
File: ann.py Project: Hydex/ann
 def outputAt(self, neuron):
     neuron_id = mutil.extractNeuronId(neuron)
     return self.neurons[neuron_id].output()