exportation et importations de réseaux neronaux

This commit is contained in:
eynard 2021-12-18 23:26:57 +01:00
parent dd47f73356
commit 83e220282c

View File

@ -129,3 +129,13 @@ class network:
def __PartialDerivative(self, layer, neuron, weight): def __PartialDerivative(self, layer, neuron, weight):
return self.__Error(layer, neuron) * self.outputs[layer][weight] 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']