pattern.java

来自「用Java实现的多层BP神经网络」· Java 代码 · 共 68 行

JAVA
68
字号
/*  AI ANN Backpropagation    Copyright (C) 2002-2003  Wim Gillis <d.e.m@gmx.net>    http://sourceforge.net/projects/crap    This program is free software; you can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation.    This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    You should have received a copy of the GNU General Public License    along with this program (see COPYING); if not, check out     http://www.gnu.org/licenses/gpl.html    or write to the Free Software Foundation,     Inc., 59 Temple Place, Suite 330, Boston,     MA  02111-1307  USA*/package cx.ma.ai.ann.backprop;import java.io.Serializable;public class Pattern implements Serializable{    private double[] in;    private double[] out;        public Pattern(double[] input, double[] output) {        in = input;         out = output;    }        public double getInput(int index){        return in[index];    }        public int getNoOfInputs(){        return in.length;    }        public double getOutput(int index){        return out[index];    }        public int getNoOfOutputs(){        return out.length;    }        public double[] getIn(){        return in;    }        public double[] getOut(){        return out;    }        public String toString(){        String ret = "in: ";        for (int i = 0; i < in.length; ++i)            ret += in[i] + " ";        ret += "\nout: ";        for (int i = 0; i < out.length; ++i)            ret += out[i] + " ";        return ret;    }}

⌨️ 快捷键说明

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