
上QQ阅读APP看书,第一时间看更新
Testing the network
This function allows us to test our network. Again, notice the return value, which makes this a fluent interface. For the most commonly used functions at a higher, more abstract layer, I tried to make the fluent interface available where it would be most beneficial, as follows:
public NNManager TestNetwork()
{
Console.WriteLine("\tTesting Network", Color.Yellow);
while (true)
{
Get the input data from the user, as follows:
var values = GetInputData($"\tType{_numInputParameters} inputs: ");
if (values == null)
{
return this;
}
Do the computations, as follows:
var results = _network?.Compute(values);
Print out the results, as follows:
foreach (var result in results)
{
Console.WriteLine("\tOutput: " +
DoubleConverter.ToExactString(result), Color.Aqua);
}
return this;
}
}