Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 23 additions & 28 deletions avae/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,22 +365,20 @@ def train(
mode="trn",
)

logging.info(
"Training : Epoch: [%d/%d] | Batch: [%d/%d] | Loss: %f | Recon: %f | "
"KLdiv: %f | Affin: %f | Beta: %f | Gamma: %f"
% (
epoch + 1,
epochs,
b + 1,
len(trains),
*t_history[-1],
beta_arr[epoch],
gamma_arr[epoch],
)
)

t_history[-1] /= len(trains)

logging.info(
"Training : Epoch: [%d/%d] | Loss: %f | Recon: %f | "
"KLdiv: %f | Affin: %f | Beta: %f | Gamma: %f"
% (
epoch + 1,
epochs,
*t_history[-1],
beta_arr[epoch],
gamma_arr[epoch],
)
)

# ########################## VAL ######################################
vae.eval()
for b, batch in enumerate(vals):
Expand Down Expand Up @@ -420,22 +418,19 @@ def train(
v_logvar,
mode="val",
)
v_history[-1] /= len(vals)

logging.info(
"Validation : Epoch: [%d/%d] | Batch: [%d/%d] | Loss: %f | Recon: %f | "
"KLdiv: %f | Affin: %f | Beta: %f | Gamma: %f"
% (
epoch + 1,
epochs,
b + 1,
len(vals),
*v_history[-1],
beta_arr[epoch],
gamma_arr[epoch],
)
logging.info(
"Validation : Epoch: [%d/%d] |Loss: %f | Recon: %f | "
"KLdiv: %f | Affin: %f | Beta: %f | Gamma: %f"
% (
epoch + 1,
epochs,
*v_history[-1],
beta_arr[epoch],
gamma_arr[epoch],
)

v_history[-1] /= len(vals)
)

if writer:
for i, loss_name in enumerate(
Expand Down