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

📄 testinputfunction.java

📁 神经网络源代码,实现了一个BP神经网络,可以完成基于BP的神经网络算法.
💻 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 + -