Example #1
0
        /// <summary>
        /// Writes this layer as XML
        /// </summary>
        /// <param name="writer">The XML writer</param>
        public void WriteTo(XmlWriter writer)
        {
            writer.WriteStartElement("layer");
            writer.WriteAttributeString("input-size", InputSize.ToString());
            writer.WriteAttributeString("output-size", OutputSize.ToString());
            writer.WriteAttributeString("activation", Activation.ToString());
            writer.WriteAttributeString("weight-init", WeightInitialisation.ToString());
            writer.WriteAttributeString("regularisation", Regularisation.ToString());
            writer.WriteAttributeString("weight-update", WeightUpdate.ToString());
            writer.WriteAttributeString("trainer", LayerTrainer.ToString());
            writer.WriteAttributeString("lambda", Lambda.ToString());
            writer.WriteAttributeString("momentum", Momentum.ToString());
            writer.WriteAttributeString("decay-rate", DecayRate.ToString());
            writer.WriteAttributeString("decay-rate2", DecayRate2.ToString());
            writer.WriteAttributeString("dropout", Dropout.ToString());
            if (Bias != null)
            {
                Bias.WriteTo("bias", writer);
            }
            if (Weight != null)
            {
                writer.WriteStartElement("weight");
                foreach (var item in Weight)
                {
                    item.WriteTo("row", writer);
                }
                writer.WriteEndElement();
            }

            writer.WriteEndElement();
        }