revised status
This commit is contained in:
+7
-11
@@ -34,8 +34,8 @@ class Layer:
|
||||
if batch_size == 0:
|
||||
batch_size = training_remain
|
||||
|
||||
status.on_change({})
|
||||
d_progress = 100.0 / (training_remain/batch_size * self.params.num_epochs)
|
||||
last_progress = 0
|
||||
batch_row_index = 0
|
||||
training_seen = 0
|
||||
keep_running = True
|
||||
@@ -67,19 +67,15 @@ class Layer:
|
||||
self.state.b_h += inc_bh
|
||||
self.state.w_hv += inc_whv
|
||||
|
||||
progress = round(training_seen*d_progress)
|
||||
if progress != last_progress:
|
||||
# Calculate error
|
||||
status.progress = round(progress)
|
||||
status.err = rms_error_accu(mini_batch - self.h_to_pv(self.v_to_ph(v_states)))
|
||||
if not status.on_change():
|
||||
keep_running = False
|
||||
break
|
||||
# Calculate error
|
||||
err_rms = rms_error_accu(mini_batch - self.h_to_pv(self.v_to_ph(v_states)))
|
||||
if not status.on_change({"progress": {"value": round(training_seen*d_progress), "unit": "%"}, "err_rms": {"value": err_rms, "unit": ""}}):
|
||||
keep_running = False
|
||||
break
|
||||
|
||||
last_progress = progress
|
||||
training_seen += 1
|
||||
|
||||
status.on_change()
|
||||
status.on_change({"progress": {"value": round(training_seen*d_progress), "unit": "%"}, "err_rms": {"value": err_rms, "unit": ""}})
|
||||
|
||||
def v_to_ph(self, v: np.ndarray) -> np.ndarray:
|
||||
state = self.state.v_to_h(v)
|
||||
|
||||
Reference in New Issue
Block a user