title: Save encog network c#
body: <p>I have an issue about how to save neural netwok in encog library c#. I want to serialize weights of hidden layer and  data from input and output layers. Also it is necessary to save somewhere structure of the network, if i want  deserialize it successfully.
  Below the part of code where i create network and serialize the BasicNetwork object, of course it is incorrect. I have found a lot of information how to do it with java version, but noting about c#.</p>
  
  <pre><code>                BasicNetwork network = CreateNet(nettype,res11[i],1,2);
                  INeuralDataSet trainingSet = new BasicNeuralDataSet(masStudyInput, masStudyOutput);
                  INeuralDataSet TestingSet = new BasicNeuralDataSet(masTestInput, mastestOutput);
                  ITrain train = new ResilientPropagation(network, trainingSet);
  
                  int epoch = 1;
                  //network.Structure.Layers.
                  MessageBox.Show("Start");
  
                  do
                  {
  
                      train.Iteration();
  
                      mist = GetMistake(ref network, ref TestingSet);
                      chart1.Invoke((Action)(() =&gt;
                      {
                          chart1.Series[0].Points.AddY(train.Error);
                          chart1.Series[1].Points.AddY(mist);
                      }));
                      network.
                      if (mist &lt; 0.8)
                     {
                      string XMLfilename = System.IO.Path.GetDirectoryName(Application.ExecutablePath) + @"\" + mist + ".xml";
                      System.Xml.Serialization.XmlSerializer writer = new System.Xml.Serialization.XmlSerializer(typeof(BasicNetwork));
                      TextWriter writerr = new StreamWriter(XMLfilename);
                      writer.Serialize(writerr, network);
                      writerr.Close();
                      }
                      epoch++;
  
                  }
                  while ((epoch &lt; 1000));SS
  </code></pre>