From 83e220282cb9871264e3a981051f61f3a40e4a71 Mon Sep 17 00:00:00 2001 From: eynard Date: Sat, 18 Dec 2021 23:26:57 +0100 Subject: [PATCH] =?UTF-8?q?exportation=20et=20importations=20de=20r=C3=A9s?= =?UTF-8?q?eaux=20neronaux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sobek/network.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/sobek/network.py b/sobek/network.py index 605c0fb..a312fd9 100755 --- a/sobek/network.py +++ b/sobek/network.py @@ -128,4 +128,14 @@ class network: return network.__sigmoid(self.activations[layer][neuron], derivative=True) * upperLayerLinksSum def __PartialDerivative(self, layer, neuron, weight): - return self.__Error(layer, neuron) * self.outputs[layer][weight] \ No newline at end of file + return self.__Error(layer, neuron) * self.outputs[layer][weight] + + + + def saveToFile(self, fileName): + np.savez(fileName, biases=self.biases, weights=self.weights) + + def loadFromFile(self, fileName): + data = np.load(fileName) + self.biases = data['biases'] + self.weights = data['weights'] \ No newline at end of file