1   /*
2    * Created on Dec 1, 2004
3    *
4    * TODO To change the template for this generated file go to
5    * Window - Preferences - Java - Code Style - Code Templates
6    */
7   package yawn.nn.committee;
8   
9   import java.util.ArrayList;
10  
11  import yawn.config.NeuralNetworkConfig;
12  import yawn.nn.AbstractCircleInTheSquareNetworkTest;
13  import yawn.nn.committee.functions.Average;
14  import yawn.nn.mlp.LayerElement;
15  import yawn.nn.mlp.MultiLayerPerceptronConfig;
16  
17  /***
18   * 
19   * <p>$Id: NetworkCommitteeTest.java,v 1.5 2005/04/20 18:55:18 supermarti Exp $</p>
20   * 
21   * @author Luis Mart&iacute; (luis dot marti at uc3m dot es)
22   * @version $Revision: 1.5 $
23   */
24  public class NetworkCommitteeTest extends AbstractCircleInTheSquareNetworkTest {
25  
26      /*
27       * (non-Javadoc)
28       * 
29       * @see yawn.nn.AbstractCircleInTheSquareNetworkTest#setupConfig()
30       */
31      protected NeuralNetworkConfig createConfig() {
32          NetworkCommitteeConfig mainConf = new NetworkCommitteeConfig();
33  
34          mainConf.setEnvironment(env);
35  
36          MultiLayerPerceptronConfig conf = new MultiLayerPerceptronConfig();
37          conf.setEnvironment(env);
38          conf.setMaxEpochs(500);
39          conf.setLearningRate(0.5);
40          conf.setPredictionError(TARGETED_PREDICTION_MSE);
41  
42          LayerElement hiddenLayer = new LayerElement();
43          hiddenLayer.setNodesClassName("yawn.nn.mlp.SigmoidNode");
44          hiddenLayer.setSize(20);
45  
46          LayerElement outputLayer = new LayerElement();
47          outputLayer.setNodesClassName("yawn.nn.mlp.LinearNode");
48          outputLayer.setSize(trainSet[0].output.size());
49  
50          ArrayList layers = new ArrayList();
51          layers.add(hiddenLayer);
52          layers.add(outputLayer);
53  
54          conf.setLayerConfigs(layers);
55  
56          CommitteeElement ce = new CommitteeElement();
57          ce.setNetworkConfig(conf);
58          ce.setAmount(3);
59  
60          mainConf.addCommitteeMember(ce);
61          mainConf.setSerialProcessing(false);
62          mainConf.setCombinationFunctionClassName(Average.class);
63  
64          return mainConf;
65      }
66  }