refactor: use tqdm instead of custom load bar
This commit is contained in:
@@ -4,6 +4,7 @@ from utils import (regularize,
|
|||||||
dynamic_loss_plot_update,
|
dynamic_loss_plot_update,
|
||||||
dynamic_loss_plot_finish)
|
dynamic_loss_plot_finish)
|
||||||
import types
|
import types
|
||||||
|
from tqdm import tqdm
|
||||||
|
|
||||||
LOADER = ['⡿', '⣟', '⣯', '⣷', '⣾', '⣽', '⣻', '⢿']
|
LOADER = ['⡿', '⣟', '⣯', '⣷', '⣾', '⣽', '⣻', '⢿']
|
||||||
|
|
||||||
@@ -88,10 +89,12 @@ class Autoencoder:
|
|||||||
epoch = 0
|
epoch = 0
|
||||||
no_improv = 0
|
no_improv = 0
|
||||||
prev_error = float('inf')
|
prev_error = float('inf')
|
||||||
|
with tqdm(bar_format="{desc} {elapsed} {rate_fmt}") as lbar :
|
||||||
while True:
|
while True:
|
||||||
print(
|
lbar.set_description(
|
||||||
f"{LOADER[epoch % len(LOADER)]} Training \t({epoch=} error={prev_error:.2f})", # noqa
|
f"{LOADER[epoch % len(LOADER)]} Training ({epoch=} error={prev_error:.2f})",
|
||||||
)
|
)
|
||||||
|
lbar.update()
|
||||||
error = 0
|
error = 0
|
||||||
for x in data_set:
|
for x in data_set:
|
||||||
input = x.flatten()
|
input = x.flatten()
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
numpy
|
numpy
|
||||||
matplotlib
|
matplotlib
|
||||||
requests
|
requests
|
||||||
|
tqdm
|
||||||
Reference in New Issue
Block a user