Phpml\NeuralNetwork\Network\LayeredNetwork::setInput PHP Method

setInput() public method

public setInput ( mixed $input )
$input mixed
    public function setInput($input)
    {
        $firstLayer = $this->layers[0];
        foreach ($firstLayer->getNodes() as $key => $neuron) {
            if ($neuron instanceof Input) {
                $neuron->setInput($input[$key]);
            }
        }
        foreach ($this->getLayers() as $layer) {
            foreach ($layer->getNodes() as $node) {
                if ($node instanceof Neuron) {
                    $node->refresh();
                }
            }
        }
        return $this;
    }