Package org.encog.engine.network.activation

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


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

    if (hidden1 > 0) {
      pattern.addHiddenLayer(hidden1);
    }
View Full Code Here


    if (name.equalsIgnoreCase(MLActivationFactory.AF_RAMP)) {
      return new ActivationRamp();
    }

    if (name.equalsIgnoreCase(MLActivationFactory.AF_SIGMOID)) {
      return new ActivationSigmoid();
    }

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

  public static final int HIDDEN_COUNT = 20;
  public static final int ITERATIONS = 10;

  public static long BenchmarkEncog(double[][] input, double[][] output) {
    BasicNetwork network = new BasicNetwork();
    network.addLayer(new BasicLayer(new ActivationSigmoid(), true,
        input[0].length));
    network.addLayer(new BasicLayer(new ActivationSigmoid(), true,
        HIDDEN_COUNT));
    network.addLayer(new BasicLayer(new ActivationSigmoid(), false,
        output[0].length));
    network.getStructure().finalizeStructure();
    network.reset();

    MLDataSet trainingSet = new BasicMLDataSet(input, output);
View Full Code Here

  public static void main(final String args[]) {
   
    // create a neural network, without using a factory
    BasicNetwork network = new BasicNetwork();
    network.addLayer(new BasicLayer(null,true,2));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),true,3));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),false,1));
    network.getStructure().finalizeStructure();
    network.reset();

    // create training data
    MLDataSet trainingSet = new BasicMLDataSet(XOR_INPUT, XOR_IDEAL);
View Full Code Here

public class ElmanXOR {

  static BasicNetwork createElmanNetwork() {
    // construct an Elman type network
    ElmanPattern pattern = new ElmanPattern();
    pattern.setActivationFunction(new ActivationSigmoid());
    pattern.setInputNeurons(1);
    pattern.addHiddenLayer(6);
    pattern.setOutputNeurons(1);
    return (BasicNetwork)pattern.generate();
  }
View Full Code Here

  }

  static BasicNetwork createFeedforwardNetwork() {
    // construct a feedforward type network
    FeedForwardPattern pattern = new FeedForwardPattern();
    pattern.setActivationFunction(new ActivationSigmoid());
    pattern.setInputNeurons(1);
    pattern.addHiddenLayer(6);
    pattern.setOutputNeurons(1);
    return (BasicNetwork)pattern.generate();
  }
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];
      layers[0] = new FlatLayer(act, input,
View Full Code Here

  public void testLayerOutput()
  {
    Layer layer1, layer2;
    BasicNetwork network = new BasicNetwork();
    network.addLayer(layer1 = new BasicLayer(null, true,2));
    network.addLayer(layer2 = new BasicLayer(new ActivationSigmoid(), true,4));
    network.addLayer(new BasicLayer(new ActivationSigmoid(), false,1));
    int i = 0;
    i++;
    layer1.setBiasActivation(0.5);
    layer2.setBiasActivation(-1.0);
    network.getStructure().finalizeStructure();
View Full Code Here

 
  public void testLayerOutputPostFinalize()
  {
    BasicNetwork network = new BasicNetwork();
    network.addLayer(new BasicLayer(null, true,2));
    network.addLayer(new BasicLayer(new ActivationSigmoid(), true,4));
    network.addLayer(new BasicLayer(new ActivationSigmoid(), false,1));

    network.getStructure().finalizeStructure();
    network.reset();
   
    network.setLayerBiasActivation(0,0.5);
View Full Code Here

  {
    // random matrix data.  However, it provides a constant starting point
    // for the unit tests.   
    BasicNetwork network = new BasicNetwork();
    network.addLayer(new BasicLayer(null,true,2));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),true,4));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),false,1));
    network.getStructure().finalizeStructure();
   
    (new ConsistentRandomizer(-1,1)).randomize(network);
   
    return network;
View Full Code Here

TOP

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

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.