Examples of calculate()


Examples of com.github.neuralnetworks.calculation.neuronfunctions.ConnectionCalculatorFullyConnected.calculate()

  ValuesProvider vp = new ValuesProvider();
  vp.addValues(c1.getInputLayer(), i1);
  vp.addValues(ol, o);

  aws.calculate(connections, vp, ol);

  // most simple case
  assertEquals(14, o.get(0, 0), 0);
  assertEquals(32, o.get(0, 1), 0);
  assertEquals(32, o.get(1, 0), 0);
View Full Code Here

Examples of com.github.neuralnetworks.calculation.neuronfunctions.ConnectionCalculatorFullyConnected.calculate()

  vp = new ValuesProvider();
  vp.addValues(c1.getInputLayer(), i1);
  vp.addValues(ol, o);

  aws = new AparapiWeightedSumConnectionCalculator();
  aws.calculate(connections, vp, ol);

  assertEquals(14.1, o.get(0, 0), 0.01);
  assertEquals(32.1, o.get(0, 1), 0.01);
  assertEquals(32.2, o.get(1, 0), 0.01);
  assertEquals(77.2, o.get(1, 1), 0.01);
View Full Code Here

Examples of com.github.neuralnetworks.calculation.neuronfunctions.ConnectionCalculatorFullyConnected.calculate()

  vp.addValues(c1.getInputLayer(), i1);
  vp.addValues(c2.getInputLayer(), i2);
  vp.addValues(ol, o);

  aws = new AparapiWeightedSumConnectionCalculator();
  aws.calculate(connections, vp, ol);

  assertEquals(28.1, o.get(0, 0), 0.01);
  assertEquals(64.1, o.get(0, 1), 0.01);
  assertEquals(64.2, o.get(1, 0), 0.01);
  assertEquals(154.2, o.get(1, 1), 0.01);
View Full Code Here

Examples of com.github.neuralnetworks.calculation.neuronfunctions.ConnectionCalculatorFullyConnected.calculate()

  ValuesProvider vp = new ValuesProvider();
  vp.addValues(c1.getOutputLayer(), i1);
  vp.addValues(ol, o);

  aws.calculate(connections, vp, ol);

  // most simple case
  assertEquals(14, o.get(0, 0), 0);
  assertEquals(32, o.get(0, 1), 0);
  assertEquals(32, o.get(1, 0), 0);
View Full Code Here

Examples of com.github.neuralnetworks.training.backpropagation.BackpropagationAveragePooling2D.calculate()

  vp = new ValuesProvider();
  vp.addValues(c.getOutputLayer(), o);
  Matrix bpo = new Matrix(32, 2);
  vp.addValues(c.getInputLayer(), bpo);

  bp.calculate(connections, vp, c.getInputLayer());

  assertEquals(true, bpo.get(0, 0) == o.get(0, 0) / c.getSubsamplingRegionLength());
  assertEquals(true, bpo.get(1, 0) == o.get(0, 0) / c.getSubsamplingRegionLength());
  assertEquals(true, bpo.get(4, 0) == o.get(0, 0) / c.getSubsamplingRegionLength());
  assertEquals(true, bpo.get(5, 0) == o.get(0, 0) / c.getSubsamplingRegionLength());
View Full Code Here

Examples of com.github.neuralnetworks.training.backpropagation.BackpropagationMaxPooling2D.calculate()

  vp.addValues(c.getOutputLayer(), o);
  vp.addValues(c.getInputLayer(), bpo);

  BackpropagationMaxPooling2D bp = new BackpropagationMaxPooling2D();
  bp.setActivations(activations);
  bp.calculate(connections, vp, c.getInputLayer());

  assertEquals(true, bpo.get(5, 0) == a1.get(5, 0));
  assertEquals(true, bpo.get(7, 0) == a1.get(7, 0));
  assertEquals(true, bpo.get(13, 0) == a1.get(13, 0));
  assertEquals(true, bpo.get(14, 0) == a1.get(14, 0));
View Full Code Here

Examples of com.heatonresearch.aifh.distance.CalculateDistance.calculate()

        for (int x = 0; x < 10; x++) {
            double[] baseClass = eq.encode(x);
            for (int y = 0; y < 10; y++) {
                if (x != y) {
                    double[] otherClass = eq.encode(y);
                    double dist = dc.calculate(baseClass, otherClass);
                    if (compareDist < AIFH.DEFAULT_PRECISION) {
                        compareDist = dist;
                    } else {
                        assertEquals(compareDist, dist, AIFH.DEFAULT_PRECISION);
                    }
View Full Code Here

Examples of com.heatonresearch.aifh.distance.EuclideanDistance.calculate()

        for (int x = 0; x < 10; x++) {
            double[] baseClass = eq.encode(x);
            for (int y = 0; y < 10; y++) {
                if (x != y) {
                    double[] otherClass = eq.encode(y);
                    double dist = dc.calculate(baseClass, otherClass);
                    if (compareDist < AIFH.DEFAULT_PRECISION) {
                        compareDist = dist;
                    } else {
                        assertEquals(compareDist, dist, AIFH.DEFAULT_PRECISION);
                    }
View Full Code Here

Examples of com.heatonresearch.aifh.error.ErrorCalculation.calculate()

        for (final BasicData pair : this.trainingData) {
            final double[] output = ralgo.computeRegression(pair.getInput());
            ec.updateError(output, pair.getIdeal(), 1.0);
        }

        return ec.calculate();
    }

    /**
     * @return The error calculation method.
     */
 
View Full Code Here

Examples of com.marimon.image.framework.MatrixCorrelation.calculate()

        ImageFileMatrix cow = new ImageFileMatrix(getCow());
        ImageFileMatrix cowHead = new ImageFileMatrix(getCowHead());

        System.out.println("Starting correlation...");
        MatrixCorrelation correlation = new MatrixCorrelation(cow, cowHead);
        correlation.calculate();
        System.out.println("... correlation finished.");
        cow = null;
        cowHead = null;
        System.gc();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.