RBMLayerCalculator lc = NNFactory.rbmSigmoidSigmoid(rbm, trainingBatchSize);
return new AparapiCDTrainer(rbmProperties(rbm, lc, trainingSet, testingSet, error, rand, learningRate, momentum, l1weightDecay, l2weightDecay, gibbsSampling, trainingBatchSize, epochs, isPersistentCD));
}
protected static Properties rbmProperties(RBM rbm, RBMLayerCalculator lc, TrainingInputProvider trainingSet, TrainingInputProvider testingSet, OutputError error, NNRandomInitializer rand, float learningRate, float momentum, float l1weightDecay, float l2weightDecay, int gibbsSampling, int trainingBatchSize, int epochs, boolean isPersistentCD) {
Properties p = new Properties();
p.setParameter(Constants.NEURAL_NETWORK, rbm);
p.setParameter(Constants.TRAINING_INPUT_PROVIDER, trainingSet);
p.setParameter(Constants.TESTING_INPUT_PROVIDER, testingSet);
p.setParameter(Constants.LEARNING_RATE, learningRate);
p.setParameter(Constants.MOMENTUM, momentum);
p.setParameter(Constants.L1_WEIGHT_DECAY, l1weightDecay);
p.setParameter(Constants.L2_WEIGHT_DECAY, l2weightDecay);
p.setParameter(Constants.GIBBS_SAMPLING_COUNT, gibbsSampling);
p.setParameter(Constants.OUTPUT_ERROR, error);
p.setParameter(Constants.RANDOM_INITIALIZER, rand);
p.setParameter(Constants.PERSISTENT_CD, isPersistentCD);
p.setParameter(Constants.LAYER_CALCULATOR, lc);
p.setParameter(Constants.TRAINING_BATCH_SIZE, trainingBatchSize);
p.setParameter(Constants.EPOCHS, epochs);
return p;
}