public TOutput Evaluate(IList <TInput> value) { InputLayer.InputValues = value; var curInputValues = InputLayer.OutputValues; var nextLayer = HiddenLayers?.GetEnumerator(); while (nextLayer?.MoveNext() ?? false) { var curLayer = nextLayer.Current; curLayer.InputValues = curInputValues; curLayer.Evaluate(); curInputValues = curLayer.OutputValues; } OutputLayer.InputValues = curInputValues; OutputLayer.Evaluate(); return(OutputLayer.OutputValue); }