diff --git a/src/rbm/rbm.py b/src/rbm/rbm.py index 2d460ac..379694a 100644 --- a/src/rbm/rbm.py +++ b/src/rbm/rbm.py @@ -47,12 +47,18 @@ def main(): # Create stack from project file stack = StackFactory.from_file("/home/jens/work/repos/Rbm/test.prj") + # Load state + stack.state_load() + # Load train data batch = read_armadillo("/home/jens/work/repos/Rbm/test.training.dat") # Train stack.train(batch) + # Save state + stack.state_save() + if __name__ == "__main__": main() print("Test: [passed]") diff --git a/src/rbm/stack.py b/src/rbm/stack.py index 0f562de..8724914 100644 --- a/src/rbm/stack.py +++ b/src/rbm/stack.py @@ -45,3 +45,7 @@ class Stack: def state_save(self): for index, layer in enumerate(self.layers): layer.save(f"{self.name}-{index}-state.npz") + + def state_load(self): + for index, layer in enumerate(self.layers): + layer.load(f"{self.name}-{index}-state.npz") \ No newline at end of file