@@ -0,0 +1,2572 @@
+package com.digiburo.backprop1b.network;%0A%0A/**%0A * Concrete output node%0A */%0Aimport java.util.Iterator;%0A%0A/**%0A * Concrete output node%0A * %0A */%0Apublic class OutputNode extends AbstractNode %7B%0A%0A%09/**%0A%09 * ctor%0A%09 * %0A%09 * @param learning_rate%0A%09 * @param momentum%0A%09 */%0A%09public OutputNode(double learning_rate, double momentum) %7B%0A%09%09this.learning_rate = learning_rate;%0A%09%09this.momentum = momentum;%0A%09%7D%0A    %0A    /**%0A     * Return learning rate%0A     * %0A     * @return learning rate%0A     */%0A    public double getLearningRate() %7B%0A    %09return(learning_rate);%0A    %7D%0A    %0A    /**%0A     * Return momentum term%0A     * %0A     * @return momentum term%0A     */%0A    public double getMomentum() %7B%0A    %09return(momentum);%0A    %7D%0A%0A%09/**%0A%09 * Update node value by summing weighted inputs%0A%09 */%0A%09public void runNode() %7B%0A%09%09double total = 0.0;%0A%0A%09%09Iterator%3CArc%3E ii = input_arcs.iterator();%0A%09%09while (ii.hasNext()) %7B%0A%09%09%09Arc arc = ii.next();%0A%09%09%09total += arc.getWeightedInputValue();%0A%09%09%7D%0A%0A%09%09value = sigmoidTransfer(total);%0A%09%7D%0A%0A%09/**%0A%09 * Update input weights based on error (delta rule)%0A%09 */%0A%09public void trainNode() %7B%0A%09%09error = computeError();%0A%0A%09%09Iterator%3CArc%3E ii = input_arcs.iterator();%0A%09%09while (ii.hasNext()) %7B%0A%09%09%09Arc arc = ii.next();%0A%09%09%09double delta = learning_rate * error * arc.getInputValue();%0A%09%09%09arc.updateWeight(delta);%0A%09%09%7D%0A%09%7D%0A    %0A    /**%0A     * Return sigmoid transfer value, result 0.0 %3C value %3C 1.0%0A     * %0A     * @return sigmoid transfer value, result 0.0 %3C value %3C 1.0%0A     */%0A    private double sigmoidTransfer(double value) %7B%0A    %09return(1.0 / (1.0 + Math.exp(-value)));%0A    %7D%0A    %0A    /**%0A     * Compute output node error using the derivative of the sigmoid transfer function.%0A     * %0A     * @return output node error%0A     */%0A    private double computeError() %7B%0A    %09return(value * (1.0 - value) * (error - value));%0A    %7D%0A    %0A    /**%0A     * Return description of object%0A     * %0A     * @return description of object%0A     */%0A    public String toString() %7B%0A    %09return(toString(%22OutputNode:%22));%0A    %7D%0A    %0A    /**%0A     * Return description of object%0A     * %0A     * @return description of object%0A     */%0A    public String toString(String prefix) %7B%0A    %09String result = prefix + super.toString() + %22 learning rate:%22 + learning_rate + %22 momentum:%22 + momentum;%0A%09%0A    %09return (result);%0A    %7D%0A    %0A    /**%0A     * learning rate is used to help compute error term.%0A     */%0A    double learning_rate;%0A    %0A    /**%0A     * momentum term is used to compute weight in Arc%0A     */%0A    double momentum;%0A    %0A    /**%0A     * eclipse generated%0A     */%0A    private static final long serialVersionUID = -8313299157918441811L;%0A%7D%0A%0A

Create OutputNode.java