Ejemplo n.º 1
0
 void BuildNetwork()
 {
     int[] layers=new int[] {
         841,1014,1250,100,10
     };
     LayerConnector[] map=new LayerConnector[] {
         new ConvolutionAuto(5,6,1,3),
         new ConvolutionAuto(5,50,6,1),
         new FullLayerConnector(),
         new FullLayerConnector()
     };
     ConvolutionalTopology topology=new ConvolutionalTopology(layers,1,map,new HyperbolicTangent());
     ConvolutionalGenerator generator=new ConvolutionalGenerator();
     Network=generator.Create(topology);
     Network.LearnFactor=0.0005;
     Network.Reset(-0.1,0.1);
 }
Ejemplo n.º 2
0
 private void button3_Click(object sender,EventArgs e)
 {
     OpenFileDialog dlg = new OpenFileDialog();
     dlg.CheckFileExists=true;
     dlg.CheckPathExists=true;
     dlg.Filter="xml files (*.xml)|*.xml";
     dlg.Multiselect=false;
      if (dlg.ShowDialog()==DialogResult.OK) {
          ConvolutionalXMLSerializer serializer=new ConvolutionalXMLSerializer();
          Network=serializer.Deserialize(XDocument.Load(dlg.FileName));
          Network.LearnFactor=0.0005;
          Loaded=true;
      }
 }
Ejemplo n.º 3
0
 public XDocument Serialize(ConvolutionalNetwork network)
 {
     return new XDocument(new XElement("root",
         new XElement("layers",network.Structure.Layers.Length.ToString()),
         GetElements(network.Structure)));
 }
Ejemplo n.º 4
0
 public void TSSetUp()
 {
     int[] layers=new int[] {
         1024, //32x32 input image
         4704, //6 @ 28x28 convolution
         1176, //6 @  14x14 subsampling
         1600, //16 @ 10x10 convolution
         400, //16 @ 5x5 subsampling
         120, // 120x1x1 convolution!
         84, //full
         10 //full
     };
     LayerConnector[] map=new LayerConnector[] {
         new ConvolutionAuto(5,6,1,4),
         new SubSampling(6),
         new Convolution(5,16,6,4,GetSchema()),
         new SubSampling(16),
         new ConvolutionAuto(5,120,16,0),
         new FullLayerConnector(),
         new FullLayerConnector()
     };
     ConvolutionalTopology topology=new ConvolutionalTopology(layers,1,map);
     ConvolutionalGenerator generator=new ConvolutionalGenerator();
     Network=generator.Create(topology);
 }
Ejemplo n.º 5
0
 public XDocument Serialize(ConvolutionalNetwork network)
 {
     return(new XDocument(new XElement("root",
                                       new XElement("layers", network.Structure.Layers.Length.ToString()),
                                       GetElements(network.Structure))));
 }