public CustomObjectScope(CustomObjects args) { this.custom_objects = args; this.backup = null; this.backup = GenericUtils._GLOBAL_CUSTOM_OBJECTS.Copy(); foreach (var objects in this.custom_objects) { GenericUtils._GLOBAL_CUSTOM_OBJECTS[objects.Key] = objects.Value; } }
public static new Sequential FromConfig(ConfigDict config, CustomObjects custom_objects = null) { List <ConfigDict> layer_configs = null; string name = ""; Shape build_input_shape = null; if (config.ContainsKey("name")) { name = config["name"].ToString(); build_input_shape = config.ContainsKey("build_input_shape") ? (Shape)config["build_input_shape"] : null; layer_configs = (List <ConfigDict>)config["layers"]; } else { // legacy config file name = null; layer_configs = new List <ConfigDict>() { config }; } var t = Type.GetType(name, true, true); Sequential model = (Sequential)Activator.CreateInstance(t); foreach (var conf in layer_configs) { var layer = Layer.FromConfig(conf.First().Key, (ConfigDict)conf.First().Value, custom_objects); model.Add(layer); } if (model.inputs == null && build_input_shape != null) { model.Build(build_input_shape); } return(model); }
/// <summary> /// Retrieves a custom object from the /// </summary> /// <param name="key">The key of the object in the dictionary</param> /// <returns>The object or null if the key was not found</returns> public object GetCustomObject(string key) { return(CustomObjects.ContainsKey(key) ? CustomObjects[key] : null); }
public static new Layer FromConfig(string cls, ConfigDict config, CustomObjects custom_objects = null) { throw new NotImplementedException(); }
public static Regularizer Deserialize(ConfigDict config, CustomObjects custom_objects = null) { return((Regularizer)Utils.GenericUtils.DeserializeKerasObject(config, custom_objects: custom_objects, printable_module_name: "regularizer")); }
public static object DeserializeKerasObject(object identifier, string module_objects = "", CustomObjects custom_objects = null, string printable_module_name = "object") { throw new NotImplementedException(); }
public static CustomObjectScope CustomObjectScope(CustomObjects args) { return(new CustomObjectScope(args)); }
public static Model ModelFromJson(string json_string, CustomObjects custom_objects = null) { throw new NotImplementedException(); }
public static Model ModelFromConfig(ConfigDict config, CustomObjects custom_objects = null) { throw new NotImplementedException(); }
public static Model LoadModel(string filepath, CustomObjects custom_objects = null, bool compile = true) { throw new NotImplementedException(); }
private static Model DeserializeModel(H5Dict f, CustomObjects custom_objects = null, bool compile = true) { throw new NotImplementedException(); }