Ejemplo n.º 1
0
 public function setUp()
 {
     //Take Associated and Reaction Neurons -> in order to test direct and reverse directions
     $this->_from = Factory::neuron(Factory::ASSOC, 0);
     $this->_to = Factory::neuron(Factory::REACT, 0);
     //Init relation
     $this->_relation = new Relation($this->_from, $this->_to);
     Net::setMode(Net::TEACHER_MODE);
 }
Ejemplo n.º 2
0
 /**
  * Full Test: check whether back propagation was successful
  * @throws \Exception
  */
 public function testAbsolute()
 {
     $_values = $this->parseYaml($this->_getCurrentFolder(__DIR__, "absolute", "absolute.yml"));
     $_values = $this->prepareValues($_values);
     $this->initCounts($this->_app, $_values);
     //Initializing and start
     $this->_app->init($_values);
     $this->_app->start();
     Net::setMode(Net::PRODUCTION_MODE);
     $this->_app->start();
     //run app with same values but in production mode
     $lastLayout = $this->_app->getLayoutCollection()->getLastLayout();
     /** @var NeuronNet\Neuron\React $winner */
     $winner = $lastLayout->seek($this->_app->getWinner());
     //Compare standard teacher value with winner`s teacher value
     $this->assertEquals(self::WINNER_TEACHER_VALUE, $winner->getTeacherValue());
 }
Ejemplo n.º 3
0
 public function setUp()
 {
     Net::setMode(Net::TEACHER_MODE);
 }
Ejemplo n.º 4
0
 /**
  * Prepare layout Collection by adding layouts there
  */
 public function setUp()
 {
     Net::setMode(Net::TEACHER_MODE);
     Net::setAllowedIterationsCount(1);
     Net::setReloadValuesVia(2);
 }