- fixed max index

- call status once inside epoch loop
This commit is contained in:
2025-12-17 19:29:46 +01:00
parent 8dcf0872b9
commit b4cd05d803
2 changed files with 6 additions and 8 deletions
+6 -6
View File
@@ -25,7 +25,7 @@ class MyStatus(Status):
shape = self.stack.from_index(0).shape[0:2] + (1,)
# User input
max_index = self.batch.shape[0]
max_index = self.batch.shape[0] - 1
key = cv.waitKeyEx(1)
if key == ord('q'):
do_continue = False
@@ -74,20 +74,20 @@ def main(prj_name: str = "test"):
stack.state_load()
# Load train data
training_data_path = os.path.join(prj_root, f"{prj_name}.training.dat")
batch = read_armadillo(training_data_path)
training_data = read_armadillo(os.path.join(prj_root, f"{prj_name}.training.dat"))
test_data = read_armadillo(os.path.join(prj_root, f"{prj_name}.test.dat"))
# Prepare status listener
my_status = MyStatus(stack, batch)
my_status = MyStatus(stack, test_data)
# Train
stack.train(batch, status=my_status)
stack.train(training_data, status=my_status)
# Save state
stack.state_save()
if __name__ == "__main__":
main("norb_small_16h")
main("norb_small_16h_v2")
cv.destroyAllWindows()
print("Test: [passed]")