Skip to content

Commit

Permalink
updated train.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JinZr committed Oct 9, 2024
1 parent 2356621 commit df87a0f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions egs/libritts/CODEC/encodec/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ def save_bad_model(suffix: str = ""):
+ params.lambda_feat * feature_loss
+ params.lambda_com * commit_loss
)
loss_info["generator_loss"] = gen_loss
for k, v in stats_g.items():
if "returned_sample" not in k:
loss_info[k] = v * batch_size
Expand Down Expand Up @@ -737,6 +738,7 @@ def compute_validation_loss(
+ disc_scale_fake_adv_loss
) * d_weight
assert disc_loss.requires_grad is False
loss_info["discriminator_loss"] = disc_loss
for k, v in stats_d.items():
loss_info[k] = v * batch_size

Expand Down Expand Up @@ -778,6 +780,7 @@ def compute_validation_loss(
+ params.lambda_com * commit_loss
)
assert gen_loss.requires_grad is False
loss_info["generator_loss"] = gen_loss
for k, v in stats_g.items():
if "returned_sample" not in k:
loss_info[k] = v * batch_size
Expand Down

0 comments on commit df87a0f

Please sign in to comment.