/// <summary> /// Copy input pattern data from an array. /// </summary> /// <param name="vector">The target array.</param> /// <param name="config">The configuration instance.</param> public override void SyncInputFrom(double[] vector, BasicConfig config) { for (int i = 0; i < _inputPattern.Length && i < vector.Length; i++) { _inputPattern[i] = config.ConvertInput(vector[i]); } }
/// <summary> /// Create a boolean pattern based on this pattern. /// </summary> /// <param name="config">The configuration instance.</param> public BooleanPattern ToBooleanPattern(BasicConfig config) { bool[] input = new bool[_inputPattern.Length]; bool[] output = new bool[_outputTraining.Length]; for (int i = 0; i < input.Length; i++) { input[i] = config.ConvertInput(_inputPattern[i]); } for (int i = 0; i < output.Length; i++) { output[i] = config.ConvertOutput(_outputTraining[i]); } return(new BooleanPattern(Title, input, output, Classification)); }
/// <summary> /// Create a double pattern based on this pattern. /// </summary> /// <param name="config">The configuration instance.</param> public DoublePattern ToDoublePattern(BasicConfig config) { double[] input = new double[_inputPattern.Length]; double[] output = new double[_outputTraining.Length]; for (int i = 0; i < input.Length; i++) { input[i] = config.ConvertInput(_inputPattern[i]); } for (int i = 0; i < output.Length; i++) { output[i] = config.ConvertOutput(_outputTraining[i]); } return(new DoublePattern(Title, input, output, Classification)); }