public override object Load(XmlNode node) { if (node == null) { return(null); } var model = XmlStorage.GetObjectValue <IModel>(node, "Model"); var batchSize = XmlStorage.GetIntValue(node, "BatchSize"); var epoch = XmlStorage.GetIntValue(node, "Epoch"); var randomBatch = bool.Parse(XmlStorage.GetStringValue(node, "RandomBatch")); var result = (Trainer)Activator.CreateInstance(Type, model, batchSize, epoch, randomBatch); result.Mission = XmlStorage.GetStringValue(node, "Mission"); result.PrintSteps = XmlStorage.GetIntValue(node, "PrintSteps"); result.LastTrainLoss = XmlStorage.GetDoubleValue(node, "LastTrainLoss"); result.LastTrainAccuracy = XmlStorage.GetDoubleValue(node, "LastTrainAccuracy"); result.LastTestLoss = XmlStorage.GetDoubleValue(node, "LastTestLoss"); result.LastTestAccuracy = XmlStorage.GetDoubleValue(node, "LastTestAccuracy"); result.PreProcessor = XmlStorage.GetObjectValue <IPreProcessor>(node, "PreProcessor"); result.LabelCodec = XmlStorage.GetObjectValue <DiscreteCodec>(node, "LabelCodec"); result.Normalizer = XmlStorage.GetObjectValue <INormalizer>(node, "Normalizer"); return(result); }
public override object Load(XmlNode node) { var result = (Adam)Activator.CreateInstance(Type); result.Alpha = XmlStorage.GetDoubleValue(node, "Alpha"); result.Beta1 = XmlStorage.GetDoubleValue(node, "Beta1"); result.Beta2 = XmlStorage.GetDoubleValue(node, "Beta2"); return(result); }
public override object Load(XmlNode node) { if (node == null) { return(null); } var mean = XmlStorage.GetDoubleValue(node, "Mean"); var delta = XmlStorage.GetDoubleValue(node, "Delta"); return(Activator.CreateInstance(Type, mean, delta)); }
public override object Load(XmlNode node) { var learningRate = XmlStorage.GetDoubleValue(node, "LearningRate"); return(Activator.CreateInstance(Type, learningRate)); }
public override object Load(XmlNode node) { var strength = XmlStorage.GetDoubleValue(node, "Strength"); return(Activator.CreateInstance(Type, strength)); }