src/demo/SimpleDemo.java
private static NeuralNetwork buildNeuralNetwork(int inputSize, int outputSize) throws DynamicParamException, NeuralNetworkException, MatrixException {
        NeuralNetwork neuralNetwork = new NeuralNetwork();
        neuralNetwork.addInputLayer("width = " + inputSize);
        neuralNetwork.addHiddenLayer(LayerType.WEIGHT_NORMALIZATION);
        neuralNetwork.addHiddenLayer(LayerType.FEEDFORWARD, new ActivationFunction(UnaryFunctionType.ELU), "width = 20");
        neuralNetwork.addHiddenLayer(LayerType.FEEDFORWARD, new ActivationFunction(UnaryFunctionType.ELU), "width = " + outputSize);
        neuralNetwork.addOutputLayer(BinaryFunctionType.HUBER);
        neuralNetwork.build();
        neuralNetwork.setOptimizer(OptimizationType.AMSGRAD);
         return neuralNetwork;
    }
/**
     * Build neural network instance for regression.
     *
     * @param inputSize input layer size (in this case 2).
     * @param outputSize output layer size (in this case 1).
     * @return neural network instance.
     * @throws DynamicParamException throws exception if setting of neural network parameters fail.
     * @throws NeuralNetworkException throws exception if creation of neural network instance fails.
     * @throws MatrixException throws exception if custom function is attempted to be created with this constructor.
     */
Build neural network instance for regression.
@param inputSize input layer size (in this case 2).
@param outputSize output layer size (in this case 1).
@return neural network instance.
@throws DynamicParamException throws exception if setting of neural network parameters fail.
@throws NeuralNetworkException throws exception if creation of neural network instance fails.
@throws MatrixException throws exception if custom function is attempted to be created with this constructor.
Build neural network instance for regression . @param inputSize input layer size ( in this case 2 ) . @param outputSize output layer size ( in this case 1 ) . @return neural network instance . @throws DynamicParamException throws exception if setting of neural network parameters fail . @throws NeuralNetworkException throws exception if creation of neural network instance fails . @throws MatrixException throws exception if custom function is attempted to be created with this constructor .
private static NeuralNetwork buildNeuralNetwork(int inputSize, int outputSize) throws DynamicParamException, NeuralNetworkException, MatrixException {
        NeuralNetwork neuralNetwork = new NeuralNetwork();
        neuralNetwork.addInputLayer("width = " + inputSize);
        neuralNetwork.addHiddenLayer(LayerType.WEIGHT_NORMALIZATION);
        neuralNetwork.addHiddenLayer(LayerType.FEEDFORWARD, new ActivationFunction(UnaryFunctionType.ELU), "width = 20");
        neuralNetwork.addHiddenLayer(LayerType.FEEDFORWARD, new ActivationFunction(UnaryFunctionType.ELU), "width = " + outputSize);
        neuralNetwork.addOutputLayer(BinaryFunctionType.HUBER);
        neuralNetwork.build();
        neuralNetwork.setOptimizer(OptimizationType.AMSGRAD);
         return neuralNetwork;
    }
private static NeuralNetwork buildNeuralNetwork ( int inputSize , int outputSize ) throws DynamicParamException , NeuralNetworkException , MatrixException { NeuralNetwork neuralNetwork = new NeuralNetwork ( ) ; neuralNetwork . addInputLayer ( "width = " + inputSize ) ; neuralNetwork . addHiddenLayer ( LayerType . WEIGHT_NORMALIZATION ) ; neuralNetwork . addHiddenLayer ( LayerType . FEEDFORWARD , new ActivationFunction ( UnaryFunctionType . ELU ) , "width = 20" ) ; neuralNetwork . addHiddenLayer ( LayerType . FEEDFORWARD , new ActivationFunction ( UnaryFunctionType . ELU ) , "width = " + outputSize ) ; neuralNetwork . addOutputLayer ( BinaryFunctionType . HUBER ) ; neuralNetwork . build ( ) ; neuralNetwork . setOptimizer ( OptimizationType . AMSGRAD ) ; return neuralNetwork ; }
Build neural network instance for regression.
Build neural network instance for regression .