Package org.encog.engine.network.activation

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


      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,
          FlatNetwork.DEFAULT_BIAS_ACTIVATION);
View Full Code Here


    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

 
  public void testPersistMediumEG()
  {
    BasicNetwork network = new BasicNetwork();
    network.addLayer(new BasicLayer(null,true,10));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),true,10));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),false,10));
    network.getStructure().finalizeStructure();
    network.reset();

    EncogDirectoryPersistence.saveObject(EG_FILENAME, network);
    BasicNetwork network2 = (BasicNetwork)EncogDirectoryPersistence.loadObject(EG_FILENAME);
View Full Code Here

 
  public void testPersistLargeEG()
  {
    BasicNetwork network = new BasicNetwork();
    network.addLayer(new BasicLayer(null,true,200));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),true,200));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),true,200));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),false,200));
    network.getStructure().finalizeStructure();
    network.reset();

    EncogDirectoryPersistence.saveObject(EG_FILENAME, network);
    BasicNetwork network2 = (BasicNetwork)EncogDirectoryPersistence.loadObject(EG_FILENAME);
View Full Code Here

import org.junit.Test;

public class TestActivationSigmoid extends TestCase {
  @Test
  public void testSigmoid() throws Throwable {
    ActivationSigmoid activation = new ActivationSigmoid();
    Assert.assertTrue(activation.hasDerivative());

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

    double[] input = { 0.0  };

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

 
  public void testCreation() {
    // create a neural network, without using a factory
    BasicNetwork basicNetwork = new BasicNetwork();
    basicNetwork.addLayer(new BasicLayer(null, true, 2));
    basicNetwork.addLayer(new BasicLayer(new ActivationSigmoid(), true, 3));
    basicNetwork
        .addLayer(new BasicLayer(new ActivationSigmoid(), false, 1));
    basicNetwork.getStructure().finalizeStructure();
    basicNetwork.reset();

    FreeformNetwork freeformNetwork = new FreeformNetwork(basicNetwork);
    Assert.assertEquals(basicNetwork.getInputCount(),
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

 
  public void testSingleOutput() {
   
    BasicNetwork network = new BasicNetwork();
    network.addLayer(new BasicLayer(null,true,2));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),true,2));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),false,1));
    network.getStructure().finalizeStructure();
   
    (new ConsistentRandomizer(-1,1)).randomize(network);
   
    MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL);   
View Full Code Here

 
  public void testDualOutput() {
   
    BasicNetwork network = new BasicNetwork();
    network.addLayer(new BasicLayer(null,true,2));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),true,2));
    network.addLayer(new BasicLayer(new ActivationSigmoid(),false,2));
    network.getStructure().finalizeStructure();
   
    (new ConsistentRandomizer(-1,1)).randomize(network);
   
    MLDataSet trainingData = new BasicMLDataSet(XOR.XOR_INPUT,XOR.XOR_IDEAL2);   
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.