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

@ -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]
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']