centeronzeroplugin.java
来自「一个纯java写的神经网络源代码」· Java 代码 · 共 46 行
JAVA
46 行
package org.joone.util;import org.joone.engine.*;/** * Center around the zero all the time series subtracting its average * Creation date: (23/10/2000 23.55.34) * @author: Administrator */public class CenterOnZeroPlugIn extends ConverterPlugIn { private static final long serialVersionUID = 8581778588210471901L; /** * CenterOnZeroPlugIn constructor comment. */ public CenterOnZeroPlugIn() { super(); } /** * Starts the convertion */ protected boolean convert(int serie) { boolean retValue = false; int s = getInputVector().size(); int i; double v; double d = 0; Pattern currPE; // Calculate average for (i = 0; i < s; ++i) d += getValuePoint(i, serie); d = d / s; // Shift average amount for (i = 0; i < s; ++i) { v = getValuePoint(i, serie); v = v - d; currPE = (Pattern) getInputVector().elementAt(i); currPE.setValue(serie, v); retValue = true; } return retValue; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?