1
2
3
4
5
6
7 package yawn.nn.mlp;
8
9 import java.util.ArrayList;
10
11 import yawn.config.NeuralNetworkConfig;
12 import yawn.nn.AbstractCircleInTheSquareNetworkTest;
13
14 /***
15 * A test of the MultiLayerPerceptron class using the circle-in-the-square
16 * problem.
17 *
18 * <p>$Id: MultiLayerPerceptronTest.java,v 1.8 2005/04/20 18:55:16 supermarti Exp $</p>
19 *
20 * @author Luis Martí (luis dot marti at uc3m dot es)
21 * @version $Revision: 1.8 $
22 */
23 public class MultiLayerPerceptronTest extends AbstractCircleInTheSquareNetworkTest {
24
25 protected NeuralNetworkConfig createConfig() {
26 MultiLayerPerceptronConfig conf = new MultiLayerPerceptronConfig();
27
28 conf.setEnvironment(env);
29
30 conf.setMaxEpochs(500);
31 conf.setLearningRate(0.2);
32 conf.setMomentumRate(0.01);
33 conf.setPredictionError(TARGETED_PREDICTION_MSE);
34
35 LayerElement hiddenLayer = new LayerElement();
36 hiddenLayer.setNodesClassName("yawn.nn.mlp.SigmoidNode");
37 hiddenLayer.setSize(20);
38
39 LayerElement outputLayer = new LayerElement();
40 outputLayer.setNodesClassName("yawn.nn.mlp.LinearNode");
41 outputLayer.setSize(env.outputSize());
42
43 ArrayList layers = new ArrayList();
44 layers.add(hiddenLayer);
45 layers.add(outputLayer);
46
47 conf.setLayerConfigs(layers);
48
49 return conf;
50 }
51
52 }