- fixed training_remain

- added total rms error after training
This commit is contained in:
2025-12-18 16:46:33 +01:00
parent 3936a5be27
commit 9000e70607
+6 -1
View File
@@ -11,7 +11,7 @@ class Entity:
self.params = params
def train(self, batch: np.ndarray, cd_func: Callable, status: Status):
training_remain = batch.shape[1]
training_remain = batch.shape[0]
batch_size = min(self.params.mini_batch_size, training_remain)
if batch_size == 0:
batch_size = training_remain
@@ -60,6 +60,11 @@ class Entity:
progress += d_progress*batch_size_remain
# Update final status
err_rms = rms_error_accu(batch - self.h_to_pv(self.v_to_ph(batch)))
status.on_change({"progress": {"value": round(progress), "unit": "%"},
"err_rms_total": {"value": err_rms, "unit": ""}})
def v_to_ph(self, v: np.ndarray) -> np.ndarray:
state = self.state.v_to_h(v)
if self.params.do_gaussian_hidden: