/// <summary> /// Saves the network to the pocket if it has a lower error than /// the existing version of the network. /// </summary> /// <param name="network">The network to add to the pocket</param> /// <param name="trainer">The trainer training the network</param> public void SaveNetwork(Network network, Trainer trainer) { if (!saved) { DataStorageTag tag = new DataStorageTag(); tag.Description = "Pocket to manage the " + error + " error."; tag["last updated"] = trainer.EpochCount; tag["error value"] = trainer.ErrorManager.GetError(error); manager.AddObject(network, tag, fileName); saved = true; } else { DataStorageTag tag = manager.GetStorageTag(fileName); tag["last updated"] = trainer.EpochCount; tag["error value"] = trainer.ErrorManager.GetError(error); manager.UpdateFile(network, tag, fileName); } lastUpdateEpoch = trainer.EpochCount; lastErrorVal = trainer.ErrorManager.GetError(error); }
/// <summary> /// Returns the data storage tag. /// </summary> /// <param name="name">The name of the data set</param> /// <returns>The data storage tag</returns> public DataStorageTag GetStorageTag(string name) { return((DataStorageTag)manager.GetStorageTag(name)); }
/// <summary> /// Returns the data storage tage associates with a given example set. /// </summary> /// <param name="name">name The name of the example set</param> /// <returns>The associated data storage tag</returns> public DataStorageTag getStorageTag(string name) { return(myManager.GetStorageTag(name)); }