Package org.encog.neural.networks.layers

Examples of org.encog.neural.networks.layers.BasicLayer


  }

  @Override
  public MLMethod createML(int inputs, int outputs) {
    BasicNetwork network = new BasicNetwork();
    network.addLayer(new BasicLayer(activation,false,inputs)); //(inputs));
    for (Integer layerSize: layers)
      network.addLayer(new BasicLayer(activation,true,layerSize));
    network.addLayer(new BasicLayer(activation,true,outputs));
    network.getStructure().finalizeStructure();
    network.reset();
    return network;
  }
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

    }
   
    public static BasicNetwork createThreeLayerNet()
    {
      BasicNetwork network = new BasicNetwork();
      network.addLayer(new BasicLayer(2));
      network.addLayer(new BasicLayer(3));
      network.addLayer(new BasicLayer(1));
      network.getStructure().finalizeStructure();
      network.reset();
      return network;
    }
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 class TestFreeform extends TestCase {
 
  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 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

  public static BasicNetwork createXORNetworkUntrained()
  {
    // 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.neural.networks.layers.BasicLayer

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.