Examples of IActivationFunction


Examples of com.neuralnetwork.shared.functions.IActivationFunction

     * Test method for {@link com.neuralnetwork.shared.functions
     * .SigmoidFunction#getFunctionType()}.
     */
    @Test
    public final void testGetFunctionType() {
        IActivationFunction f = new SigmoidFunction();
        FunctionType t = f.getFunctionType();
        assertEquals(t, FunctionType.SIGMOID);
    }
View Full Code Here

Examples of com.neuralnetwork.shared.functions.IActivationFunction

     * Test method for {@link com.neuralnetwork.shared.functions
     * .SigmoidFunction#equals()}.
     */
    @Test
    public final void testEquals() {
        IActivationFunction f = new SigmoidFunction();
        IActivationFunction f1 = new SigmoidFunction();
       
        assertEquals(f, f1);
        assertEquals(f, f);
       
        f = new SigmoidFunction();
View Full Code Here

Examples of com.neuralnetwork.shared.functions.IActivationFunction

     * Test method for {@link com.neuralnetwork.shared.functions
     * .SigmoidFunction#hashCode()}.
     */
    @Test
    public final void testHashCode() {
        IActivationFunction f = new SigmoidFunction();
        IActivationFunction f1 = new SigmoidFunction();
       
        assertEquals(f.hashCode(), f1.hashCode());
        assertEquals(f.hashCode(), f.hashCode());
    }
View Full Code Here

Examples of com.neuralnetwork.shared.functions.IActivationFunction

     * @param expected
     *      the expected output from the sigmoid function
     */
    private void testValue(final double input, final double expected) {
        LOGGER.debug("===== Sigmoid Function Test. =====");
        IActivationFunction f = new SigmoidFunction();
        double v = f.activate(input);
        LOGGER.debug(" Input: " + input);
        LOGGER.debug(" Value: " + v);
        LOGGER.debug(" Expected: " + expected);
        assertEquals(v, expected , DELTA * Math.ulp(expected));
        LOGGER.debug("==================================");
View Full Code Here

Examples of com.neuralnetwork.shared.functions.IActivationFunction

     *      the expected output from the sigmoid function
     */
    private void testDerivativeValue(final double input,
        final double expected) {
        LOGGER.debug("===== Sigmoid Derivative Test. =====");
        IActivationFunction f = new SigmoidFunction();
        double v = f.derivative(input);
        LOGGER.debug(" Input: " + input);
        LOGGER.debug(" Value: " + v);
        LOGGER.debug(" Expected: " + expected);
        assertEquals(v, expected , DELTA * Math.ulp(expected));
        LOGGER.debug("====================================");
View Full Code Here

Examples of zdenekdrahos.AI.ActivationFunctions.IActivationFunction

        }
    }

    private double getNeuronOutput() {
        double inputSum = getInputSum();
        IActivationFunction activationFunction = currentLayer.getActivationFunction();
        return activationFunction.activate(inputSum);
    }
View Full Code Here

Examples of zdenekdrahos.AI.ActivationFunctions.IActivationFunction

        }
        return error;
    }

    private double getDelta(int layerIndex, int neuronIndex, double error) {
        IActivationFunction act = network.getLayer(layerIndex).getActivationFunction();
        double derivate = act.derivate(currentValues.get(neuronIndex));
        return error * derivate;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.