How to do it...

  1. Initialize the ComputationGraph model configuration using the init() method:
ComputationGraphConfiguration configuration = compGraphBuilder.build();
ComputationGraph model = new ComputationGraph(configuration);
model.init();
  1. Set a score listener to monitor the training process:
model.setListeners(new ScoreIterationListener(20), new EvaluativeListener(testIterator, 1, InvocationType.EPOCH_END));
  1. Start the training instance by calling the fit() method:
model.fit(trainIterator,numOfEpochs);
  1. Call evaluate() to calculate the evaluation metrics:
Evaluation evaluation = model.evaluate(testIterator);
System.out.println(evaluation.stats());

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset