public Element CreateElementNS(String namespaceURI, String tagName) { Element element = null; if (namespaceURI == Namespaces.Html) { element = HTMLElement.Factory(tagName); } else if (namespaceURI == Namespaces.Svg) { element = SVGElement.Create(tagName); } else if (namespaceURI == Namespaces.MathML) { element = MathMLElement.Create(tagName); } else if (namespaceURI == Namespaces.Xml) { element = XMLElement.Create(tagName); } else { element = new Element { NamespaceURI = namespaceURI, NodeName = tagName } }; element.OwnerDocument = this; return(element); }
internal override XMLElement ToXML() { XMLElement e = XMLElement.Create(GetType().Name); e.AddAttribute("FilterSize", $"{FilterSize}"); e.AddAttribute("Stride", $"{Stride}"); return(e); }
internal override XMLElement ToXML() { XMLElement e = XMLElement.Create(GetType().Name); e.AddAttribute("Width", $"{Width}"); e.AddAttribute("Height", $"{Height}"); e.AddAttribute("Depth", $"{Depth}"); return(e); }
public string ToXML() { XMLElement rootXE = XMLElement.Create(GetType().Name); rootXE.AddAttribute("Layers", this.layers.Length.ToString()); for (int i = 0; i < this.layers.Length; i++) { XMLElement layerXE = this.layers[i].ToXML(); layerXE.AddAttribute("Index", $"{i}"); rootXE.AddChild(layerXE); } return(XMLWriter.Parse(rootXE)); }
internal override XMLElement ToXML() { XMLElement e = XMLElement.Create(GetType().Name); e.AddAttribute("FilterCount", $"{FilterCount}"); e.AddAttribute("FilterSize", $"{FilterSize}"); e.AddAttribute("Stride", $"{Stride}"); e.AddAttribute("ZeroPadding", $"{ZeroPadding}"); e.AddChild(Activation.ToXML()); StringBuilder sb = new StringBuilder(); XMLElement weightsXE = XMLElement.Create("Weights"); e.AddChild(weightsXE); for (int i = 0; i < this.weights.Length; i++) { if (i != 0) { sb.Append(","); } sb.Append(this.weights[i]); } weightsXE.Value = sb.ToString(); sb.Clear(); XMLElement biasesXE = XMLElement.Create("Biases"); e.AddChild(biasesXE); for (int i = 0; i < this.biases.Length; i++) { if (i != 0) { sb.Append(","); } sb.Append(this.biases[i]); } biasesXE.Value = sb.ToString(); return(e); }
internal XMLElement ToXML() { XMLElement e = XMLElement.Create("ActivationFunction"); e.AddAttribute("Name", Name); XMLElement customDataXE = XMLElement.Create("CustomData"); e.AddChild(customDataXE); foreach (KeyValuePair <string, (Type t, object val)> tuple in this.customData) { XMLElement tupleXE = XMLElement.Create(tuple.Key); tupleXE.AddAttribute("Type", tuple.Value.t.FullName); tupleXE.AddAttribute("Value", tuple.Value.val.ToString()); customDataXE.AddChild(tupleXE); } return(e); }