xor: load and save weights

This commit is contained in:
2025-12-16 18:40:51 +01:00
parent 5404f2bce0
commit 6a3c59999e
+2
View File
@@ -120,10 +120,12 @@ def xor():
status = Status()
layer = RbmLayer("Layer_0", 3, 16, params)
layer.init(0.01)
layer.load()
# Train
training_batch = np.array([[0,1,1], [0,0,0], [1,1,0], [1,0,1]], dtype=np.float64)
layer.train(training_batch, cd_jens, status)
layer.save()
# Test
test_batch = np.array([[0,0,0], [0,1,0], [1,0,0], [1,1,0]], dtype=np.float64)