⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 weight.java

📁 神经网络源代码,实现了一个BP神经网络,可以完成基于BP的神经网络算法.
💻 JAVA
字号:
package net.openai.ai.nn.network;import java.io.*;public class Weight implements Serializable {    double value = 0;    double lastDelta = 0;    public Weight() {	//  set the initial weight to be a random number between -1 and 1	value = (Math.random() - 0.5);    }    /**     *     * Get the weight's value.     * @return double The value of this weight.     */    public double getValue() {	return value;    }        /**     *     * Set the weight's value.     * @param value The value of this weight.     */    public void setValue(double value) {	lastDelta = this.value - value;	this.value = value;    }    /**     *     * Get the weight's lastDelta.     * @return double The lastDelta of this weight.     */    public double getLastDelta() {	return lastDelta;    }        /**     *     * Set the weight's lastDelta.     * @param lastDelta The lastDelta of this weight.     */    public void setLastDelta(double lastDelta) {	this.lastDelta = lastDelta;    }}

⌨️ 快捷键说明

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