public class Perceptron { private int trainingSetSize = 0; private int inputSize = 2; // Fixed for now. private double inputs[][]; private double desiredOutputs[];// Output is for a network of one neuron. private double[] weights; private double learningRate; // TODO: Programmer determined. // add as param? public void initNetwork(double[][] inputs, double[] desiredOutputs) { this.inputs = inputs; this.trainingSetSize = inputs.length; if (this.trainingSetSize == 0) { System.out.println("No training data."); System.exit(0); } this.desiredOutputs = desiredOutputs; this.weights = new double[inputSize]; //TODO: initialize the weights to small random values in the range ]0.00..0.10] this.weights[0] = 1;// TODO: init to small random weights this.weights[1] = 1;// TODO: init to small random weights this.learningRate = 1000000; //TODO: Set the learning rate to a non-crazy number. } //TODO: write this simple function. private double sigmoidActivationFunction(double input){ } //TODO: write this simple function. private double derivative(double activation){ } //TODO: write this function. Feel free to grab code from the EngineeredPerceptron public void trainPerceptronSigmoid(int epochs){ } public void printWeights(){ for (int j = 0; j < inputSize; j++){ System.out.printf("\nWeight from input %d is: %f", j, weights[j]); } } //TODO: write this function. Feel free to grab code from the EngineeredPerceptron. Now that // you have a sigmoid activation function, you need to determine a non-binary way of // determining whether your network produced the right output. public void testNetworkSigmoid(){ } }