Package de.jungblut.math.squashing

Examples of de.jungblut.math.squashing.LogisticErrorFunction


        .create(
            new int[] { 2, 4, 1 },
            new ActivationFunction[] { LINEAR.get(),
                ActivationFunctionSelector.ELLIOT.get(),
                ActivationFunctionSelector.ELLIOT.get() },
            new LogisticErrorFunction(), new Fmincg(), 100).build();
    Tuple<DoubleVector[], DoubleVector[]> sampleXOR = sampleXOR();
    double error = mlp.train(sampleXOR.getFirst(), sampleXOR.getSecond(),
        new Fmincg(), 100, 0.0d, false);
    System.out.println(error);
    // increase the error here a bit, because it is just an approx. to sigmoid
View Full Code Here


  public void testXORFminCG() {
    MultilayerPerceptron mlp = MultilayerPerceptron.MultilayerPerceptronBuilder
        .create(
            new int[] { 2, 4, 1 },
            new ActivationFunction[] { LINEAR.get(), SIGMOID.get(),
                SIGMOID.get() }, new LogisticErrorFunction(), new Fmincg(), 100)
        .build();
    Tuple<DoubleVector[], DoubleVector[]> sampleXOR = sampleXOR();
    double error = mlp.train(sampleXOR.getFirst(), sampleXOR.getSecond(),
        new Fmincg(), 100, 0.0d, false);
    System.out.println(error);
View Full Code Here

  public void testXORPSO() {
    MultilayerPerceptron mlp = MultilayerPerceptron.MultilayerPerceptronBuilder
        .create(
            new int[] { 2, 4, 1 },
            new ActivationFunction[] { LINEAR.get(), SIGMOID.get(),
                SIGMOID.get() }, new LogisticErrorFunction(), new Fmincg(), 100)
        .build();
    Tuple<DoubleVector[], DoubleVector[]> sampleXOR = sampleXOR();
    double error = mlp.train(sampleXOR.getFirst(), sampleXOR.getSecond(),
        new ParticleSwarmOptimization(1000, 2.8d, 0.2, 0.4, 4), 400, 0.0d,
        false);
View Full Code Here

        .build();
    MultilayerPerceptron mlp = MultilayerPerceptron.MultilayerPerceptronBuilder
        .create(
            new int[] { 2, 4, 1 },
            new ActivationFunction[] { LINEAR.get(), SIGMOID.get(),
                SIGMOID.get() }, new LogisticErrorFunction(), minimizer, 15000)
        .stochastic().miniBatchSize(1).build();
    Tuple<DoubleVector[], DoubleVector[]> sampleXOR = sampleXOR();
    mlp.train(sampleXOR.getFirst(), sampleXOR.getSecond());
    validatePredictions(sampleXOR, mlp);
  }
View Full Code Here

    if (mlp == null) {
      mlp = MultilayerPerceptron.MultilayerPerceptronBuilder
          .create(
              new int[] { 2, 4, 1 },
              new ActivationFunction[] { LINEAR.get(), SIGMOID.get(),
                  SIGMOID.get() }, new LogisticErrorFunction(), new Fmincg(),
              100).build();
    }
    Tuple<DoubleVector[], DoubleVector[]> sampleXOR = sampleXOR();
    double error = mlp.train(sampleXOR.getFirst(), sampleXOR.getSecond(),
        new Fmincg(), 100, 0.0d, false);
View Full Code Here

TOP

Related Classes of de.jungblut.math.squashing.LogisticErrorFunction

Copyright © 2018 www.massapicom. 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.