src/demo/MNISTDemo.java
private static NeuralNetwork buildNeuralNetwork(int inputSize, int outputSize) throws DynamicParamException, NeuralNetworkException, MatrixException {
        NeuralNetwork neuralNetwork = new NeuralNetwork();
        neuralNetwork.addInputLayer("width = 28, height = 28");
        neuralNetwork.addHiddenLayer(LayerType.CROSSCORRELATION, new ActivationFunction(UnaryFunctionType.RELU), Initialization.UNIFORM_XAVIER_CONV, "filters = 12, filterSize = 3, stride = 1");
        neuralNetwork.addHiddenLayer(LayerType.RANDOM_POOLING, "filterSize = 2, stride = 1");
        neuralNetwork.addHiddenLayer(LayerType.CROSSCORRELATION, new ActivationFunction(UnaryFunctionType.RELU), Initialization.UNIFORM_XAVIER_CONV, "filters = 24, filterSize = 3, stride = 1");
        neuralNetwork.addHiddenLayer(LayerType.RANDOM_POOLING, "filterSize = 2, stride = 1");
        neuralNetwork.addHiddenLayer(LayerType.BATCH_NORMALIZATION);
        neuralNetwork.addHiddenLayer(LayerType.FEEDFORWARD, new ActivationFunction(UnaryFunctionType.RELU), "width = 100");
        neuralNetwork.addHiddenLayer(LayerType.FEEDFORWARD, new ActivationFunction(UnaryFunctionType.SOFTMAX), "width = " + outputSize);
        neuralNetwork.addOutputLayer(BinaryFunctionType.CROSS_ENTROPY);
        neuralNetwork.build();
        neuralNetwork.setOptimizer(OptimizationType.ADADELTA);
        return neuralNetwork;
    }
/**
     * Function that builds Convolutional Neural Network (CNN).<br>
     * MNIST images (size 28x28) are used as inputs.<br>
     * Outputs are 10 discrete outputs where each output represents single digit.<br>
     *
     * @param inputSize input size of convolutional neural network.
     * @param outputSize output size of convolutional neural network.
     * @return CNN instance.
     * @throws DynamicParamException throws exception is setting of parameters fails.
     * @throws NeuralNetworkException throws exception if creation of CNN fails.
     * @throws MatrixException throws exception if custom function is attempted to be created with this constructor.
     */
Function that builds Convolutional Neural Network (CNN).
MNIST images (size 28x28) are used as inputs.
Outputs are 10 discrete outputs where each output represents single digit.

@param inputSize input size of convolutional neural network.
@param outputSize output size of convolutional neural network.
@return CNN instance.
@throws DynamicParamException throws exception is setting of parameters fails.
@throws NeuralNetworkException throws exception if creation of CNN fails.
@throws MatrixException throws exception if custom function is attempted to be created with this constructor.
Function that builds Convolutional Neural Network ( CNN ) . MNIST images ( size 28x28 ) are used as inputs . Outputs are 10 discrete outputs where each output represents single digit . @param inputSize input size of convolutional neural network . @param outputSize output size of convolutional neural network . @return CNN instance . @throws DynamicParamException throws exception is setting of parameters fails . @throws NeuralNetworkException throws exception if creation of CNN 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 = 28, height = 28");
        neuralNetwork.addHiddenLayer(LayerType.CROSSCORRELATION, new ActivationFunction(UnaryFunctionType.RELU), Initialization.UNIFORM_XAVIER_CONV, "filters = 12, filterSize = 3, stride = 1");
        neuralNetwork.addHiddenLayer(LayerType.RANDOM_POOLING, "filterSize = 2, stride = 1");
        neuralNetwork.addHiddenLayer(LayerType.CROSSCORRELATION, new ActivationFunction(UnaryFunctionType.RELU), Initialization.UNIFORM_XAVIER_CONV, "filters = 24, filterSize = 3, stride = 1");
        neuralNetwork.addHiddenLayer(LayerType.RANDOM_POOLING, "filterSize = 2, stride = 1");
        neuralNetwork.addHiddenLayer(LayerType.BATCH_NORMALIZATION);
        neuralNetwork.addHiddenLayer(LayerType.FEEDFORWARD, new ActivationFunction(UnaryFunctionType.RELU), "width = 100");
        neuralNetwork.addHiddenLayer(LayerType.FEEDFORWARD, new ActivationFunction(UnaryFunctionType.SOFTMAX), "width = " + outputSize);
        neuralNetwork.addOutputLayer(BinaryFunctionType.CROSS_ENTROPY);
        neuralNetwork.build();
        neuralNetwork.setOptimizer(OptimizationType.ADADELTA);
        return neuralNetwork;
    }
private static NeuralNetwork buildNeuralNetwork ( int inputSize , int outputSize ) throws DynamicParamException , NeuralNetworkException , MatrixException { NeuralNetwork neuralNetwork = new NeuralNetwork ( ) ; neuralNetwork . addInputLayer ( "width = 28, height = 28" ) ; neuralNetwork . addHiddenLayer ( LayerType . CROSSCORRELATION , new ActivationFunction ( UnaryFunctionType . RELU ) , Initialization . UNIFORM_XAVIER_CONV , "filters = 12, filterSize = 3, stride = 1" ) ; neuralNetwork . addHiddenLayer ( LayerType . RANDOM_POOLING , "filterSize = 2, stride = 1" ) ; neuralNetwork . addHiddenLayer ( LayerType . CROSSCORRELATION , new ActivationFunction ( UnaryFunctionType . RELU ) , Initialization . UNIFORM_XAVIER_CONV , "filters = 24, filterSize = 3, stride = 1" ) ; neuralNetwork . addHiddenLayer ( LayerType . RANDOM_POOLING , "filterSize = 2, stride = 1" ) ; neuralNetwork . addHiddenLayer ( LayerType . BATCH_NORMALIZATION ) ; neuralNetwork . addHiddenLayer ( LayerType . FEEDFORWARD , new ActivationFunction ( UnaryFunctionType . RELU ) , "width = 100" ) ; neuralNetwork . addHiddenLayer ( LayerType . FEEDFORWARD , new ActivationFunction ( UnaryFunctionType . SOFTMAX ) , "width = " + outputSize ) ; neuralNetwork . addOutputLayer ( BinaryFunctionType . CROSS_ENTROPY ) ; neuralNetwork . build ( ) ; neuralNetwork . setOptimizer ( OptimizationType . ADADELTA ) ; return neuralNetwork ; }
Function that builds Convolutional Neural Network (CNN).<br>
 MNIST images (size 28x28) are used as inputs.<br>
 Outputs are 10 discrete outputs where each output represents single digit.<br>
Function that builds Convolutional Neural Network ( CNN ) . <br > MNIST images ( size 28x28 ) are used as inputs . <br > Outputs are 10 discrete outputs where each output represents single digit . <br >