@@ -0,0 +1,2153 @@
+/*%0D%0A * To change this license header, choose License Headers in Project Properties.%0D%0A * To change this template file, choose Tools %7C Templates%0D%0A * and open the template in the editor.%0D%0A */%0D%0Apackage neuralnet;%0D%0A%0D%0Aimport java.util.ArrayList;%0D%0A%0D%0A/**%0D%0A *%0D%0A * @author Sean Vogel%0D%0A */%0D%0Apublic class NeuralNet %7B%0D%0A%0D%0A    /**%0D%0A     * First dimension are the network layers%0D%0A     * Second dimension are the neurons of the layers %0D%0A     */%0D%0A    private final ArrayList%3CArrayList%3CNeuron%3E%3E network;%0D%0A    %0D%0A    /**%0D%0A     * Constructor %0D%0A     * %0D%0A     * First arg is number of neurons in input layer%0D%0A     * Last arg is number of neurons in output layer%0D%0A     * Each other is the number of neurons in that hidden layer%0D%0A     * %0D%0A     * @param layers %0D%0A     */%0D%0A    public NeuralNet(int... layers) %7B%0D%0A        network = new ArrayList%3C%3E();%0D%0A        for(int size : layers) %7B%0D%0A            ArrayList%3CNeuron%3E a = new ArrayList%3C%3E();%0D%0A            for(int i = 0; i %3C size; ++i) %7B                         %0D%0A                a.add(new Neuron());//add neurons to layer%0D%0A            %7D%0D%0A            network.add(a);//add a layer to the network%0D%0A        %7D%0D%0A        createLinks();%0D%0A    %7D%0D%0A    %0D%0A    /**%0D%0A     * %0D%0A     */%0D%0A    private void createLinks() %7B%0D%0A        for(int i = 0; i %3C network.size() - 1; ++i) %7B//foreach layer%0D%0A            for(Neuron n1 : network.get(i)) %7B//foreach neuron%0D%0A                for(Neuron n2 : network.get(i+1)) %7B%0D%0A                    Link l = new Link();%0D%0A                    l.prev = n1; l.next = n2;%0D%0A                    n1.forward.add(l);%0D%0A                    n2.backward.add(l);%0D%0A                %7D%0D%0A            %7D%0D%0A        %7D        %0D%0A    %7D%0D%0A    %0D%0A    /**%0D%0A     * %0D%0A     */%0D%0A    public void feedForward() %7B%0D%0A        %0D%0A    %7D%0D%0A    %0D%0A    /**%0D%0A     * %0D%0A     */%0D%0A    public void backPropagate() %7B%0D%0A        %0D%0A    %7D%0D%0A    %0D%0A    /**%0D%0A     * %0D%0A     * @param in %0D%0A     */%0D%0A    public void input(double%5B%5D in) %7B%0D%0A        if(in.length != network.get(0).size()) throw new IllegalArgumentException();%0D%0A    %7D%0D%0A    %0D%0A    /**%0D%0A     * Activation function%0D%0A     * @param x%0D%0A     * @return %0D%0A     */%0D%0A    private double activate(double x) %7B return 1 / (1 + Math.exp(-x)); %7D  %0D%0A%7D%0D%0A

Add some code