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