📄 weight.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 + -