- fixed max index
- call status once inside epoch loop
This commit is contained in:
+6
-6
@@ -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]")
|
||||
|
||||
Reference in New Issue
Block a user