Conditions | 6 |
Paths | 12 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
55 | public function setInput($input): Network |
||
56 | { |
||
57 | $firstLayer = $this->layers[0]; |
||
58 | |||
59 | foreach ($firstLayer->getNodes() as $key => $neuron) { |
||
60 | if ($neuron instanceof Input) { |
||
61 | $neuron->setInput($input[$key]); |
||
62 | } |
||
63 | } |
||
64 | |||
65 | foreach ($this->getLayers() as $layer) { |
||
66 | foreach ($layer->getNodes() as $node) { |
||
67 | if ($node instanceof Neuron) { |
||
68 | $node->reset(); |
||
69 | } |
||
70 | } |
||
71 | } |
||
72 | |||
73 | return $this; |
||
74 | } |
||
76 |