public void TestPersistSerial() { HopfieldNetwork network = new HopfieldNetwork(4); network.SetWeight(1, 1, 1); SerializeObject.Save(SERIAL_FILENAME.ToString(), network); HopfieldNetwork network2 = (HopfieldNetwork)SerializeObject.Load(SERIAL_FILENAME.ToString()); ValidateHopfield(network2); }
public void TestPersistEG() { HopfieldNetwork network = new HopfieldNetwork(4); network.SetWeight(1, 1, 1); network.SetProperty("x", 10); EncogDirectoryPersistence.SaveObject(EG_FILENAME, network); HopfieldNetwork network2 = (HopfieldNetwork)EncogDirectoryPersistence.LoadObject((EG_FILENAME)); ValidateHopfield(network2); }