Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. diff --git a/main.py b/main.py
  2. index 84607cb..91c9066 100644
  3. --- a/main.py
  4. +++ b/main.py
  5. @@ -486,6 +486,13 @@ if __name__ == '__main__':
  6. # Forward pass W
  7. decoder.train()
  8. normalize_kernels(decoder, args.filters_norm) # Project each kernel in module to the sphere
  9. + if batch_id == 0:
  10. + import torch.nn.functional as F
  11. + import torchvision
  12. +
  13. + w = decoder.backbone[0][0].weight.permute(1, 0, 2, 3)
  14. + w = F.interpolate(w, scale_factor=8)
  15. + torchvision.utils.save_image(w, f'foo/w_{epoch:02d}.png', nrow=4, normalize=True)
  16. rec = decoder(Zs)
  17. rec_loss = MSE(X, rec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement