private function createNode(string $nodeClass, ActivationFunction $activationFunction = null) { if (Neuron::class == $nodeClass) { return new Neuron($activationFunction); } return new $nodeClass(); }