Beispiel #1
0
 /**
  * Sending data from higher to lower neuron
  * @param $signal
  * @param $weight
  * @dataProvider prepareSendingData
  */
 public function testReverseSend($signal, $weight)
 {
     $this->_to->setValue($signal);
     $this->_relation->setWeight($weight);
     Net::setDirection(Net::REVERSE);
     //signal propagation
     $this->_relation->send($this->_to);
     $this->assertEquals($signal * $weight, array_sum($this->_from->getSignals()));
     $this->_from->flushSignals();
     //flush all signals
     $this->_relation->setWeight(Relation::DEFAULT_WEIGHT);
     //set default weight
 }