Examples of train()


Examples of com.github.neuralnetworks.training.DNNLayerTrainer.train()

  Map<NeuralNetwork, OneStepTrainer<?>> layerTrainers = new HashMap<>();
  layerTrainers.put(firstRBM, firstTrainer);
  layerTrainers.put(secondRBM, secondTrainer);

  DNNLayerTrainer trainer = TrainerFactory.dnnLayerTrainer(dbn, layerTrainers, inputProvider, null, null);
  trainer.train();
 
  assertEquals(0.2 + 0.13203661, cg1.get(0, 0), 0.00001);
  assertEquals(0.4 - 0.22863509,  cg1.get(0, 1), 0.00001);
  assertEquals(-0.5 + 0.12887852, cg1.get(0, 2), 0.00001);
  assertEquals(-0.3 + 0.26158813, cg1.get(1, 0), 0.00001);
View Full Code Here

Examples of com.github.neuralnetworks.training.DNNLayerTrainer.train()

  Map<NeuralNetwork, OneStepTrainer<?>> layerTrainers = new HashMap<>();
  layerTrainers.put(firstRBM, firstTrainer);
  layerTrainers.put(secondRBM, secondTrainer);

  DNNLayerTrainer trainer = TrainerFactory.dnnLayerTrainer(dbn, layerTrainers, inputProvider, null, null);
  trainer.train();
 
  assertEquals(0.2 + 0.13203661, cg1.get(0, 0), 0.00001);
  assertEquals(0.4 - 0.22863509,  cg1.get(0, 1), 0.00001);
  assertEquals(-0.5 + 0.12887852, cg1.get(0, 2), 0.00001);
  assertEquals(-0.3 + 0.26158813, cg1.get(1, 0), 0.00001);
View Full Code Here

Examples of com.github.neuralnetworks.training.backpropagation.BackPropagationAutoencoder.train()

  // sequential execution for debugging
  Environment.getInstance().setExecutionMode(EXECUTION_MODE.SEQ);

  // training
  t.train();

  // the output layer is removed, thus making the hidden layer the new output
  ae.removeLayer(ae.getOutputLayer());

  // testing
View Full Code Here

Examples of com.github.neuralnetworks.training.backpropagation.BackPropagationAutoencoder.train()

      bae.addEventListener(new LogTrainingListener(Thread.currentThread().getStackTrace()[1].getMethodName()));

      // execution mode
      Environment.getInstance().setExecutionMode(EXECUTION_MODE.SEQ);

      bae.train();

      // the output layer is needed only during the training phase...
      ae.removeLayer(ae.getOutputLayer());

      bae.test();
View Full Code Here

Examples of com.github.neuralnetworks.training.backpropagation.BackPropagationAutoencoder.train()

      BackPropagationAutoencoder bae = TrainerFactory.backPropagationAutoencoder(ae, trainInputProvider, testInputProvider, error, new NNRandomInitializer(new MersenneTwisterRandomInitializer(-0.01f, 0.01f)), 0.02f, 0.7f, 0f, 0f, 0f, 1, 1, 100);

      // log data to console
      bae.addEventListener(new LogTrainingListener(Thread.currentThread().getStackTrace()[1].getMethodName()));

      bae.train();

      // the output layer is needed only during the training phase...
      ae.removeLayer(ae.getOutputLayer());

      bae.test();
View Full Code Here

Examples of com.github.neuralnetworks.training.backpropagation.BackPropagationAutoencoder.train()

  // early stopping
  //t.addEventListener(new EarlyStoppingListener(t.getTrainingInputProvider(), 1000, 0.1f));

  // training
  t.train();

  // the output layer is removed, thus making the hidden layer the new output
  ae.removeLayer(ae.getOutputLayer());

  // testing
View Full Code Here

Examples of com.github.neuralnetworks.training.rbm.AparapiCDTrainer.train()

  // log data
  t.addEventListener(new LogTrainingListener(Thread.currentThread().getStackTrace()[1].getMethodName(), true, false));

  // training
  t.train();

  // testing
  t.test();

  assertEquals(0, t.getOutputError().getTotalNetworkError(), 0);
View Full Code Here

Examples of com.github.neuralnetworks.training.rbm.AparapiCDTrainer.train()

  t.addEventListener(new LogTrainingListener(Thread.currentThread().getStackTrace()[1].getMethodName(), true, false));

  Environment.getInstance().setExecutionMode(EXECUTION_MODE.SEQ);

  // training
  t.train();

  // testing
  t.test();
 
  assertEquals(0, t.getOutputError().getTotalNetworkError(), 0);
View Full Code Here

Examples of com.github.neuralnetworks.training.rbm.AparapiCDTrainer.train()

  AparapiCDTrainer t = TrainerFactory.cdSigmoidTrainer(rbm, new SimpleInputProvider(new float[][] { { 1, 0, 1 } }, null, 1, 1), null, null, null, 1f, 0f, 0f, 0f, 1, true);
  t.setLayerCalculator(NNFactory.rbmSigmoidSigmoid(rbm));

  Environment.getInstance().setExecutionMode(EXECUTION_MODE.SEQ);

  t.train();

  assertEquals(0.52276707, cgb1.get(0, 0), 0.00001);
  assertEquals(- 0.54617375, cgb1.get(1, 0), 0.00001);
  assertEquals(0.51522285, cgb1.get(2, 0), 0.00001);
 
View Full Code Here

Examples of com.github.neuralnetworks.training.rbm.AparapiCDTrainer.train()

  // execution mode
  Environment.getInstance().setExecutionMode(EXECUTION_MODE.SEQ);

  // training
  t.train();

  // training
  t.test();

  // 2 of the iris classes are linearly not separable - an error of 1/3 illustrates that
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.