Package org.encog.engine.network.activation

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


    double slope = 1;

    ActivationFunction activation = null;
   
    if (inputLayer)
      activation = new ActivationLinear();
    else if (t == Linear.class) {
      slope = ((Linear) transfer).getSlope();
      activation = new ActivationLinear();
    } else if (t == Sigmoid.class) {
      slope = ((Sigmoid) transfer).getSlope();
      activation = new ActivationSigmoid();
    } else if (t == Tanh.class) {
      slope = ((Tanh) transfer).getSlope();
View Full Code Here


      final int outputCount, final RadialBasisFunction[] rbf) {

    FlatLayer[] layers = new FlatLayer[3];
    this.rbf = rbf;

    layers[0] = new FlatLayer(new ActivationLinear(), inputCount, 0.0);
    layers[1] = new FlatLayer(new ActivationLinear(), hiddenCount, 0.0);
    layers[2] = new FlatLayer(new ActivationLinear(), outputCount, 0.0);

    init(layers);
  }
View Full Code Here

   *            True if this is a tanh activation, false for sigmoid.
   */
  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)) {
View Full Code Here

   * @return The generated network.
   */
  public final MLMethod generate() {
    final BasicNetwork network = new BasicNetwork();

    final Layer inputLayer = new BasicLayer(new ActivationLinear(), true,
        this.inputNeurons);
    final Layer outputLayer = new BasicLayer(new ActivationLinear(), false,
        this.outputNeurons);

    network.addLayer(inputLayer);
    network.addLayer(outputLayer);
    network.getStructure().finalizeStructure();
View Full Code Here

    final FlatLayer[] flatLayers = new FlatLayer[this.layers.size()];

    for (int i = 0; i < this.layers.size(); i++) {
      final BasicLayer layer = (BasicLayer) this.layers.get(i);
      if (layer.getActivation() == null) {
        layer.setActivation(new ActivationLinear());
      }

      flatLayers[i] = layer;
    }
View Full Code Here

    if (name.equalsIgnoreCase(MLActivationFactory.AF_GAUSSIAN)) {
      return new ActivationGaussian();
    }

    if (name.equalsIgnoreCase(MLActivationFactory.AF_LINEAR)) {
      return new ActivationLinear();
    }

    if (name.equalsIgnoreCase(MLActivationFactory.AF_LOG)) {
      return new ActivationLOG();
    }
View Full Code Here

    this.rbf = rbf;
   
    double[] slope = new double[1];
    slope[0] = 1.0;

    layers[0] = new FlatLayer(new ActivationLinear(), inputCount, 0.0,
        slope);
    layers[1] = new FlatLayer(new ActivationLinear(), hiddenCount, 0.0,
        slope);
    layers[2] = new FlatLayer(new ActivationLinear(), outputCount, 0.0,
        slope);

    init(layers);
  }
View Full Code Here

public class TestActivationLinear extends TestCase {
  @Test
  public void testLinear() throws Throwable
  {
    ActivationLinear activation = new ActivationLinear();
    Assert.assertTrue(activation.hasDerivative());
   
    ActivationLinear clone = (ActivationLinear)activation.clone();
    Assert.assertNotNull(clone);
   
    double[] input = { 1,2,3 };
   
    activation.activationFunction(input,0,input.length);
View Full Code Here

        "NEAT Activation Function", true));


    render();
    this.setNeatActivationFunction(new ActivationSigmoid());
    this.setOutputActivationFunction(new ActivationLinear());
  }
View Full Code Here

      break;
    case 2:
      newActivation = new ActivationGaussian(0, 1, 1);
      break;
    case 3:
      newActivation = new ActivationLinear();
      break;
    case 4:
      newActivation = new ActivationLOG();
      break;
    case 5:
View Full Code Here

TOP

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

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.