Exemplo n.º 1
0
    public void Serialize(XmlNode aParent)
    {
        var doc     = aParent.OwnerDocument;
        var context = new SerializationContext <Neuron>();

        var nNetwork = aParent.AppendChild(doc.CreateElement("NeuronalNetwork"));

        input.Serialize(nNetwork.AppendChild(doc.CreateElement("Inputs")), context);
        output.Serialize(nNetwork.AppendChild(doc.CreateElement("Outputs")), context);
        var nLayers = nNetwork.AppendChild(doc.CreateElement("Layers"));

        for (int i = 0; i < layers.Count; i++)
        {
            layers[i].Serialize(nLayers, context);
        }
    }