private static void bpParityTest() throws TooMuchInputLayersException, InvalidDimensionsException {
        double[][] inputs = new double[][]{
                new double[]{0,0,0},
                new double[]{0,0,1},
                new double[]{0,1,0},
                new double[]{0,1,1},
                new double[]{1,0,0},
                new double[]{1,0,1},
                new double[]{1,1,0},
                new double[]{1,1,1},
        };

        double[][] outputs = new double[][]{
                new double[]{0},
                new double[]{1},
                new double[]{1},
                new double[]{0},
                new double[]{1},
                new double[]{0},
                new double[]{0},
                new double[]{1}
        };

        BPNetwork bpNetwork = new BPNetwork(3);
        bpNetwork.addLayer(new NetworkLayer(ActivationFunctionType.TANSIG, initializeWeights(3, 8, new RandomWeightsInitializer(-0.1, 1.1))));
        bpNetwork.addLayer(new NetworkLayer(ActivationFunctionType.TANSIG, initializeWeights(8, 1, new RandomWeightsInitializer(-0.1, 1.1))));

        LearningParameters learningParameters = new LearningParameters();
        learningParameters.setAlpha(0.15);
        learningParameters.setMomentum(0.05);
        bpNetwork.setLearningParameters(learningParameters);
        bpNetwork.setWithBias(true);

        bpNetwork.setLearningMode(true);
        for (int i = 0; i < 10000; i++) {
            int j = 0;
            for (double[] input : inputs) {
                bpNetwork.setInputs(input);
                bpNetwork.setExpectedOutput(outputs[j]);
                bpNetwork.calculate();
                j++;
            }
        }

        learningParameters.setAlpha(0.05);
        learningParameters.setMomentum(0.02);
        for (int i = 0; i < 10000; i++) {
            int j = 0;
            for (double[] input : inputs) {
                bpNetwork.setInputs(input);
                bpNetwork.setExpectedOutput(outputs[j]);
                bpNetwork.calculate();
                j++;
            }
        }

        bpNetwork.setLearningMode(false);


        for (double[] input : inputs) {
            networkTest(bpNetwork, input);
        }

        bpNetwork.printWeights();
        bpNetwork.printRmsError();

    }