trainingelement.java

来自「神经网络源代码,实现了一个BP神经网络,可以完成基于BP的神经网络算法.」· Java 代码 · 共 87 行

JAVA
87
字号
package net.openai.ai.nn.training;import java.util.*;public class TrainingElement {    //  holds the input for this training element    private Vector input = null;        //  holds the desired output for this element    private Vector desired = null;    //  holds the current output that was calcuated for this element    private Vector output = null;    public TrainingElement() {	input = new Vector();	output = new Vector();    }    public TrainingElement(Vector input, Vector desired) {	this();	this.input = input;	this.desired = desired;;    }    /**     * Returns the input values for this element     * @return Vector input values.     */    public Vector getInput() {	return input;    }    /**     * Sets the input values for this element     * @param Vector input values.     */    public void setInput(Vector input) {	this.input = input;    }    /**     * Returns the desired values for this element     * @return Vector desired values.     */    public Vector getDesired() {	return desired;    }    /**     * Sets the desired values for this element     * @param Vector desired values.     */    public void setDesired(Vector desired) {	this.desired = desired;    }    /**     * Returns the current output values for this element     * @return Vector input values.     */    public Vector getOutput() {	return output;    }    /**     * Sets the output values for this element     * @param Vector output values.     */    public void setOutput(Vector output) {	this.output = output;    }    /**     * Returns a string representation of the training element.     *     * @return String String representation.     */    public String toString() {	String element = "\nInput:\n" + input.toString() + "\n";	element += "Desired:\n" + desired.toString() + "\n"; 	element += "Output:\n" + output.toString() + "\n"; 	return element;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?