This commit is contained in:
Andras Schmelczer 2024-06-25 09:05:26 +01:00
commit 16ba45546b
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
3 changed files with 120 additions and 506 deletions

View file

@ -64,7 +64,7 @@ def train(
optimizer.zero_grad()
predicted_original = model(edited_histogram.to(device))
loss = loss_function(
torch.log(torch.clamp(predicted_original, EPSILON, 1)),
torch.log(predicted_original + EPSILON),
original_histogram.to(device),
)
@ -101,7 +101,7 @@ def train(
):
predicted_original = model(edited_histogram.to(device))
epoch_test_loss += loss_function(
torch.log(torch.clamp(predicted_original, EPSILON, 1)),
torch.log(predicted_original + EPSILON),
original_histogram.to(device),
).item()
writer.add_hparams(