Skip to content

Commit

Permalink
Simplified output
Browse files Browse the repository at this point in the history
  • Loading branch information
mkranzlein committed Aug 31, 2023
1 parent 81d386c commit c113c0c
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/hipool/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,13 @@ def train_loop(data_loader, model, optimizer, device, overlap_len, scheduler=Non
# TODO: Figure out types
# outputs_to_eval = (outputs_to_eval > .5).long()
targets = torch.cat(targets, dim=0).float().to(device)
print(sum(targets))
loss = loss_fun(outputs_to_eval, targets)
loss.backward()
model.float()
optimizer.step()
if scheduler:
scheduler.step()
losses.append(loss.item())
if batch_idx % 10 == 0:
print(
f"___ batch index = {batch_idx} / {len(data_loader)} ({100*batch_idx / len(data_loader):.2f}%), loss = {np.mean(losses[-10:]):.4f}, time = {time.time()-t0:.2f} secondes ___") # noqa E501
t0 = time.time()

return losses

Expand Down

0 comments on commit c113c0c

Please sign in to comment.