private static NeuralNetwork deserialize(string path, ExperimentLog?log = null) { log?.startPhase("Deserialization", $"source file {path}", 0); string json = File.ReadAllText(path); NeuralNetwork nn = NeuralNetwork.deserialize(json); log?.endPhase(); log?.recordTopologyFromNetwork(nn); return(nn); }
private static List <NeuralNetwork> setupNNs(ExperimentLog?log = null) { List <NeuralNetwork> nns = new List <NeuralNetwork>(); for (int i = 0; i < parallelNns; i++) { NeuralNetwork nn = new NeuralNetwork(); nn.setInputLength(784); nn.addDenseLayer(300, new Sigmoid()); nn.addDenseLayer(10, new Sigmoid()); nn.fillPropertiesRandomly(); nns.Add(nn); } log?.recordTopologyFromNetwork(nns[0]); return(nns); }