@Test public void testNeuralNetwork() throws IOException { testNeuralNetwork("testNeuralNetworkXORLocal", false, false, 10000); testNeuralNetwork("testNeuralNetworkXORWithMomentum", true, false, 5000); testNeuralNetwork("testNeuralNetworkXORWithRegularization", true, true, 5000); }
public NeuralNetwork() { this.learningRate = DEFAULT_LEARNING_RATE; this.regularizationWeight = DEFAULT_REGULARIZATION_WEIGHT; this.momentumWeight = DEFAULT_MOMENTUM_WEIGHT; this.trainingMethod = TrainingMethod.GRADIENT_DESCENT; this.costFunctionName = "Minus_Squared"; this.modelType = this.getClass().getSimpleName(); this.layerSizeList = Lists.newArrayList(); this.layerSizeList = Lists.newArrayList(); this.weightMatrixList = Lists.newArrayList(); this.prevWeightUpdatesList = Lists.newArrayList(); this.squashingFunctionList = Lists.newArrayList(); }
NeuralNetwork { public NeuralNetwork() { this.learningRate = DEFAULT_LEARNING_RATE; this.regularizationWeight = DEFAULT_REGULARIZATION_WEIGHT; this.momentumWeight = DEFAULT_MOMENTUM_WEIGHT; this.trainingMethod = TrainingMethod.GRADIENT_DESCENT; this.costFunctionName = "Minus_Squared"; this.modelType = this.getClass().getSimpleName(); this.layerSizeList = Lists.newArrayList(); this.layerSizeList = Lists.newArrayList(); this.weightMatrixList = Lists.newArrayList(); this.prevWeightUpdatesList = Lists.newArrayList(); this.squashingFunctionList = Lists.newArrayList(); } }
NeuralNetwork { public NeuralNetwork() { this.learningRate = DEFAULT_LEARNING_RATE; this.regularizationWeight = DEFAULT_REGULARIZATION_WEIGHT; this.momentumWeight = DEFAULT_MOMENTUM_WEIGHT; this.trainingMethod = TrainingMethod.GRADIENT_DESCENT; this.costFunctionName = "Minus_Squared"; this.modelType = this.getClass().getSimpleName(); this.layerSizeList = Lists.newArrayList(); this.layerSizeList = Lists.newArrayList(); this.weightMatrixList = Lists.newArrayList(); this.prevWeightUpdatesList = Lists.newArrayList(); this.squashingFunctionList = Lists.newArrayList(); } NeuralNetwork();  NeuralNetwork(double learningRate, double momentumWeight, double regularizationWeight);  NeuralNetwork(String modelPath); }
NeuralNetwork { public NeuralNetwork() { this.learningRate = DEFAULT_LEARNING_RATE; this.regularizationWeight = DEFAULT_REGULARIZATION_WEIGHT; this.momentumWeight = DEFAULT_MOMENTUM_WEIGHT; this.trainingMethod = TrainingMethod.GRADIENT_DESCENT; this.costFunctionName = "Minus_Squared"; this.modelType = this.getClass().getSimpleName(); this.layerSizeList = Lists.newArrayList(); this.layerSizeList = Lists.newArrayList(); this.weightMatrixList = Lists.newArrayList(); this.prevWeightUpdatesList = Lists.newArrayList(); this.squashingFunctionList = Lists.newArrayList(); } NeuralNetwork();  NeuralNetwork(double learningRate, double momentumWeight, double regularizationWeight);  NeuralNetwork(String modelPath); String getModelType(); NeuralNetwork setLearningRate(double learningRate); double getLearningRate(); NeuralNetwork setRegularizationWeight(double regularizationWeight); double getRegularizationWeight(); NeuralNetwork setMomentumWeight(double momentumWeight); double getMomentumWeight(); NeuralNetwork setTrainingMethod(TrainingMethod method); TrainingMethod getTrainingMethod(); NeuralNetwork setCostFunction(String costFunction); int addLayer(int size, boolean isFinalLayer, String squashingFunctionName); int getLayerSize(int layer); Matrix getWeightsByLayer(int layerIdx); void updateWeightMatrices(Matrix[] matrices); void setWeightMatrices(Matrix[] matrices); void setWeightMatrix(int index, Matrix matrix); Matrix[] getWeightMatrices(); Vector getOutput(Vector instance); void trainOnline(Vector trainingInstance); Matrix[] trainByInstance(Vector trainingInstance); void writeModelToFile(); void setModelPath(String modelPath); String getModelPath(); void write(DataOutput output); void readFields(DataInput input); }
NeuralNetwork { public NeuralNetwork() { this.learningRate = DEFAULT_LEARNING_RATE; this.regularizationWeight = DEFAULT_REGULARIZATION_WEIGHT; this.momentumWeight = DEFAULT_MOMENTUM_WEIGHT; this.trainingMethod = TrainingMethod.GRADIENT_DESCENT; this.costFunctionName = "Minus_Squared"; this.modelType = this.getClass().getSimpleName(); this.layerSizeList = Lists.newArrayList(); this.layerSizeList = Lists.newArrayList(); this.weightMatrixList = Lists.newArrayList(); this.prevWeightUpdatesList = Lists.newArrayList(); this.squashingFunctionList = Lists.newArrayList(); } NeuralNetwork();  NeuralNetwork(double learningRate, double momentumWeight, double regularizationWeight);  NeuralNetwork(String modelPath); String getModelType(); NeuralNetwork setLearningRate(double learningRate); double getLearningRate(); NeuralNetwork setRegularizationWeight(double regularizationWeight); double getRegularizationWeight(); NeuralNetwork setMomentumWeight(double momentumWeight); double getMomentumWeight(); NeuralNetwork setTrainingMethod(TrainingMethod method); TrainingMethod getTrainingMethod(); NeuralNetwork setCostFunction(String costFunction); int addLayer(int size, boolean isFinalLayer, String squashingFunctionName); int getLayerSize(int layer); Matrix getWeightsByLayer(int layerIdx); void updateWeightMatrices(Matrix[] matrices); void setWeightMatrices(Matrix[] matrices); void setWeightMatrix(int index, Matrix matrix); Matrix[] getWeightMatrices(); Vector getOutput(Vector instance); void trainOnline(Vector trainingInstance); Matrix[] trainByInstance(Vector trainingInstance); void writeModelToFile(); void setModelPath(String modelPath); String getModelPath(); void write(DataOutput output); void readFields(DataInput input);  }