Package org.encog.neural.pattern

Examples of org.encog.neural.pattern.FeedForwardPattern


        .getInstance().getMainWindow());
    dialog.setActivationFunctionHidden(new ActivationTANH());
    dialog.setActivationFunctionOutput(new ActivationTANH());
   
    if (dialog.process()) {
      FeedForwardPattern feedforward = new FeedForwardPattern();
      feedforward.setActivationFunction(dialog.getActivationFunctionHidden());
      feedforward.setActivationOutput(dialog.getActivationFunctionOutput());
      feedforward.setInputNeurons(dialog.getInputCount().getValue());
      for (int i = 0; i < dialog.getHidden().getModel().size(); i++) {
        String str = (String) dialog.getHidden().getModel()
            .getElementAt(i);
        int i1 = str.indexOf(':');
        int i2 = str.indexOf("neur");
        if (i1 != -1 && i2 != -1) {
          str = str.substring(i1 + 1, i2).trim();
          int neuronCount = Integer.parseInt(str);
          feedforward.addHiddenLayer(neuronCount);
        }
      }
      feedforward.setInputNeurons(dialog.getInputCount().getValue());
      feedforward.setOutputNeurons(dialog.getOutputCount().getValue());
      return feedforward.generate();
    }
    return null;

  }
View Full Code Here


      if( training == null ) {
        return null;
      }
     
     
      FeedForwardPattern pattern = new FeedForwardPattern();
      pattern.setInputNeurons(training.getInputSize());
      pattern.setOutputNeurons(training.getIdealSize());
   
     
      pattern.setActivationFunction(dialog.getActivationFunction());     
      IncrementalPruneTab tab = new IncrementalPruneTab(
          dialog.getIterations().getValue(),
          dialog.getWeightTries().getValue(),
          dialog.getWindowSize().getValue(),
          training,
View Full Code Here

   * @return The neural network.
   */
  public static BasicNetwork simpleFeedForward(final int input,
      final int hidden1, final int hidden2, final int output,
      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) {
      pattern.addHiddenLayer(hidden1);
    }
    if (hidden2 > 0) {
      pattern.addHiddenLayer(hidden2);
    }

    final BasicNetwork network = (BasicNetwork)pattern.generate();
    network.reset();
    return network;
  }
View Full Code Here

    Assert.assertTrue(MockTrain.getFirstElement(network)<20);
  }
 
  public void testSmart()
  {
    FeedForwardPattern pattern = new FeedForwardPattern();
    pattern.setInputNeurons(1);
    pattern.setOutputNeurons(1);
    BasicNetwork network = (BasicNetwork)pattern.generate();
   
    SmartLearningRate strategy1 = new SmartLearningRate();
    SmartMomentum strategy2 = new SmartMomentum();
    MockTrain mock = new MockTrain();
    mock.setNetwork(network);
View Full Code Here

    Assert.assertTrue(strategy.shouldStop());
  }
 
  public void testGreedy()
  {
    FeedForwardPattern pattern = new FeedForwardPattern();
    pattern.setInputNeurons(1);
    pattern.setOutputNeurons(1);
    BasicNetwork network = (BasicNetwork)pattern.generate();
    MockTrain.setFirstElement(3.0,network);
   
    MockTrain mock = new MockTrain();
    mock.setNetwork(network);
    Greedy strategy = new Greedy();
View Full Code Here

    Assert.assertTrue(alt.wasUsed());
  }
 
  public void testReset()
  {
    FeedForwardPattern pattern = new FeedForwardPattern();
    pattern.setInputNeurons(1);
    pattern.setOutputNeurons(1);
    BasicNetwork network = (BasicNetwork)pattern.generate();
   
    ResetStrategy strategy = new ResetStrategy(0.95,2);
    MockTrain mock = new MockTrain();
    mock.setNetwork(network);
    mock.addStrategy(strategy);
View Full Code Here

TOP

Related Classes of org.encog.neural.pattern.FeedForwardPattern

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.