Package org.encog.engine.network.activation

Examples of org.encog.engine.network.activation.ActivationTANH


    } else if (t == Sigmoid.class) {
      slope = ((Sigmoid) transfer).getSlope();
      activation = new ActivationSigmoid();
    } else if (t == Tanh.class) {
      slope = ((Tanh) transfer).getSlope();
      activation = new ActivationTANH();
    } else
      return null;

    if (biasCount > 1)
      return null;
View Full Code Here


   *
   * @param neuronCount
   *            How many neurons in this layer.
   */
  public BasicLayer(final int neuronCount) {
    this(new ActivationTANH(), true, neuronCount);
  }
View Full Code Here

  public FlatNetwork(final int input, final int hidden1, final int hidden2,
      final int output, final boolean tanh) {

    final ActivationFunction linearAct = new ActivationLinear();
    FlatLayer[] layers;
    final ActivationFunction act = tanh ? new ActivationTANH()
        : new ActivationSigmoid();

    if ((hidden1 == 0) && (hidden2 == 0)) {
      layers = new FlatLayer[2];
      layers[0] = new FlatLayer(linearAct, input,
View Full Code Here

      final boolean tanh) {
    final FeedForwardPattern pattern = new FeedForwardPattern();
    pattern.setInputNeurons(input);
    pattern.setOutputNeurons(output);
    if (tanh) {
      pattern.setActivationFunction(new ActivationTANH());
    } else {
      pattern.setActivationFunction(new ActivationSigmoid());
    }

    if (hidden1 > 0) {
View Full Code Here

    if (name.equalsIgnoreCase(MLActivationFactory.AF_STEP)) {
      return new ActivationStep();
    }

    if (name.equalsIgnoreCase(MLActivationFactory.AF_TANH)) {
      return new ActivationTANH();
    }

    return null;
  }
View Full Code Here

   */
  public FlatNetwork(final int input, final int hidden1, final int hidden2,
      final int output, final boolean tanh) {
    final double[] params = new double[1];
    FlatLayer[] layers;
    final ActivationFunction act = tanh ? new ActivationTANH()
        : new ActivationSigmoid();
    params[0] = 1; // slope

    if ((hidden1 == 0) && (hidden2 == 0)) {
      layers = new FlatLayer[2];
View Full Code Here

import org.junit.Test;

public class TestActivationTANH extends TestCase {
  @Test
  public void testTANH() throws Throwable {
    ActivationTANH activation = new ActivationTANH();
    Assert.assertTrue(activation.hasDerivative());

    ActivationTANH clone = (ActivationTANH) activation.clone();
    Assert.assertNotNull(clone);

    double[] input = { 0.0  };

    activation.activationFunction(input,0,input.length);
View Full Code Here

  {
    FeedForwardPattern pattern = new FeedForwardPattern();
    pattern.setInputNeurons(3);
    pattern.addHiddenLayer(50);
    pattern.setOutputNeurons(1);
    pattern.setActivationFunction(new ActivationTANH());
    BasicNetwork network = (BasicNetwork)pattern.generate();
    network.reset();
    return network;
  }
View Full Code Here

      break;
    case 8:
      newActivation = new ActivationStep();
      break;           
    case 9:
      newActivation = new ActivationTANH();
      break;
    case 10:
      newActivation = new ActivationRamp();
      break;     
View Full Code Here

    if (dialog.process()) {
      JordanPattern jordan = new JordanPattern();
      jordan.setInputNeurons(dialog.getInputCount().getValue());
      jordan.addHiddenLayer(dialog.getHiddenCount().getValue());
      jordan.setOutputNeurons(dialog.getOutputCount().getValue());
      jordan.setActivationFunction(new ActivationTANH());
      return jordan.generate();
    } else
      return null;

  }
View Full Code Here

TOP

Related Classes of org.encog.engine.network.activation.ActivationTANH

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.