@Test public void testEvaluate() { final double[] params = {5, 0, 0, 0}; final GaussianFunction funct = new GaussianFunction(3, params, 0); final double[] x = {-1, 0, 1}; final double y = funct.evaluate(x); assertEquals(0.9607894391523232, y, AIFH.DEFAULT_PRECISION); }
@Override public double evaluate(final double[] x) { double value = 0; final double width = getWidth(); for (int i = 0; i < getDimensions(); i++) { final double center = this.getCenter(i); value += Math.pow(x[i] - center, 2) / (2.0 * width * width); } return Math.exp(-value); }
GaussianFunction extends AbstractRBF { @Override public double evaluate(final double[] x) { double value = 0; final double width = getWidth(); for (int i = 0; i < getDimensions(); i++) { final double center = this.getCenter(i); value += Math.pow(x[i] - center, 2) / (2.0 * width * width); } return Math.exp(-value); } }
GaussianFunction extends AbstractRBF { @Override public double evaluate(final double[] x) { double value = 0; final double width = getWidth(); for (int i = 0; i < getDimensions(); i++) { final double center = this.getCenter(i); value += Math.pow(x[i] - center, 2) / (2.0 * width * width); } return Math.exp(-value); } GaussianFunction(final int theDimensions, final double[] theParams, final int theIndex); }
GaussianFunction extends AbstractRBF { @Override public double evaluate(final double[] x) { double value = 0; final double width = getWidth(); for (int i = 0; i < getDimensions(); i++) { final double center = this.getCenter(i); value += Math.pow(x[i] - center, 2) / (2.0 * width * width); } return Math.exp(-value); } GaussianFunction(final int theDimensions, final double[] theParams, final int theIndex); @Override double evaluate(final double[] x); }
GaussianFunction extends AbstractRBF { @Override public double evaluate(final double[] x) { double value = 0; final double width = getWidth(); for (int i = 0; i < getDimensions(); i++) { final double center = this.getCenter(i); value += Math.pow(x[i] - center, 2) / (2.0 * width * width); } return Math.exp(-value); } GaussianFunction(final int theDimensions, final double[] theParams, final int theIndex); @Override double evaluate(final double[] x);  }