/// <summary> /// Create a new neural data pair object of the correct size for the neural /// network that is being trained. This object will be passed to the getPair /// method to allow the neural data pair objects to be copied to it. /// </summary> /// /// <param name="inputSize">The size of the input data.</param> /// <param name="idealSize">The size of the ideal data.</param> /// <returns>A new neural data pair object.</returns> public static IEngineData CreatePair(int inputSize, int idealSize) { IEngineData result; if (idealSize > 0) { result = new BasicEngineData(new double[inputSize], new double[idealSize]); } else { result = new BasicEngineData(new double[inputSize]); } return(result); }
/// <summary> /// Create a new neural data pair object of the correct size for the neural /// network that is being trained. This object will be passed to the getPair /// method to allow the neural data pair objects to be copied to it. /// </summary> /// /// <param name="inputSize">The size of the input data.</param> /// <param name="idealSize">The size of the ideal data.</param> /// <returns>A new neural data pair object.</returns> public static IEngineData CreatePair(int inputSize, int idealSize) { IEngineData result; if (idealSize > 0) { result = new BasicEngineData(new double[inputSize], new double[idealSize]); } else { result = new BasicEngineData(new double[inputSize]); } return result; }
/// <summary> /// Add input and expected output. This is used for supervised training. /// </summary> /// /// <param name="inputData">The input data to train on.</param> /// <param name="idealData">The ideal data to use for training.</param> public void Add(double[] inputData, double[] idealData) { IEngineData pair = new BasicEngineData(inputData, idealData); this.data.Add(pair); }