📄 testinputfunction.java
字号:
package net.openai.ai.nn.input;import java.util.*;import net.openai.ai.nn.network.*;public class TestInputFunction extends InputFunction { // this method will get all the neurons connections and // calculate the input for this neuron. public final void calculateInput(Neuron neuron) { double input = 0; boolean hasFromConnections = false; Vector connections = neuron.getConnections(); int size = connections.size(); for(int i = 0; i < size; i++) { Connection connection = (Connection) connections.elementAt(i); if(!neuron.equals(connection.getToNeuron())) continue; hasFromConnections = true; Neuron fromNeuron = connection.getFromNeuron(); Weight weight = connection.getWeight(); input += (fromNeuron.getOutput() * weight.getValue()); //db("Upstream Output: " + fromNeuron.getOutput()); //db("Weight value: " + weight.getValue()); } if(hasFromConnections) neuron.setInput(input); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -