Beispiel #1
0
 /**
  * @param Neuron $_pretender
  */
 public function compare(Neuron $_pretender)
 {
     if ($this->_isLast) {
         //only for React Neuron`s Layout
         if ($_pretender->getValue() > $this->_pretender["value"]) {
             $this->_pretender["value"] = $_pretender->getValue();
             $this->_pretender["index"] = $_pretender->getIndex();
         }
     }
 }
Beispiel #2
0
 /**
  * Test Weight Correction after sending signal. Direction Should be always Reverse
  * @param $signal
  * @param $weight
  * @dataProvider prepareSendingData
  * @depends testDirectSend
  * @depends testReverseSend
  */
 public function testWeightCorrection($signal, $weight)
 {
     Net::setDirection(Net::REVERSE);
     //signal propagation
     $this->_to->setValue($signal);
     $this->_from->setValue($this->_oldValue);
     $this->_relation->setWeight($weight);
     $this->_relation->send($this->_to);
     //Test whether weight correction is null or no
     $this->assertNotEquals($weight, $this->getWeightFromRelation($this->_relation), "Back Propagation Stuck");
 }
Beispiel #3
0
 /**
  * @param \Sereban\NeuronNet\Neuron $neuron
  */
 protected function _addLayoutToNeuron(NeuronNet\Neuron $neuron)
 {
     $layout = new NeuronNet\Layout();
     $neuron->setLayout($layout);
 }