Package com.neuralnetwork.shared.functions

Examples of com.neuralnetwork.shared.functions.SigmoidFunction


        public static double evaluate(
                final TransferFunction transferFunction,
                final double input) {
            switch (transferFunction) {
                case Sigmoid:
                    return new SigmoidFunction().activate(input);
                case None:
                default:
                    break;
            }
            return input;
View Full Code Here


        public static double evaluateDerivitive(
                final TransferFunction transferFunction,
                final double input) {
            switch (transferFunction) {
                case Sigmoid:
                    return new SigmoidFunction().derivative(input);
                case None:
                default:
                    break;
            }
            return input;
View Full Code Here

     * 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

     * 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();
        f1 = null;
       
        assertFalse(f.equals(f1));
        assertFalse(f.equals(new DoubleValue(0.0)));
    }
View Full Code Here

     * 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

     * @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

     *      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

    Neuron o1 = new OutputNeuron();
    m.addOutputLink(o);
    m.addOutputLink(o1);
    m.setActivationFunction(null);
    assertEquals(m.getActivationFunction(), null);
    m.setActivationFunction(new SigmoidFunction());
    assertEquals(m.getActivationFunction(), new SigmoidFunction());
  }
View Full Code Here

    Neuron o1 = new OutputNeuron();
    m.addOutputLink(o);
    m.addOutputLink(o1);
    m.setActivationFunction(null);
    assertEquals(m.getActivationFunction(), null);
    m.setActivationFunction(new SigmoidFunction());
    assertEquals(m.getActivationFunction(), new SigmoidFunction());
  }
View Full Code Here

    n1 = new InputNeuron();
    assertFalse(n.equals(n1));
    n1.setType(null);
    n1.setActivationFunction(null);
    assertEquals(n, n1);
    n.setActivationFunction(new SigmoidFunction());
    assertFalse(n.equals(n1));
   
    Neuron i = new InputNeuron();
    Neuron i1 = new InputNeuron();
    Neuron m = new HiddenNeuron();
View Full Code Here

TOP

Related Classes of com.neuralnetwork.shared.functions.SigmoidFunction

Copyright © 2018 www.massapicom. 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.