inputs = $inputs; $this->weights = $weights; $this->bias = $bias; } /** * Add neuron input * * @param mixed $input Input * @param float $weight Weight of input * * @return void * * @since 1.0.0 */ public function addInput(mixed $input, float $weight) : void { $this->inputs[] = $input; $this->weights[] = $weight; } /** * Create node output * * @return float * * @since 1.0.0 */ public function output() : float { $length = \count($this->inputs); $output = 0.0; for ($i = 0; $i < $length; ++$i) { $output += $this->inputs[$i]->output() * $this->weights[$i]; } return $output + $this->bias; // return $this->activationFunction($output + $this->bias); } }