To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit fe5ce3df authored by Lukas's avatar Lukas
Browse files

debug output for new angle loss

parent e257acf7
......@@ -6,6 +6,7 @@ from torch_models.torch_utils.utils import get_gpu_memory
from torch_models.torch_utils.utils import timing_decorator
from memory_profiler import profile
#import torch.profiler
from torch_models.torch_utils.custom_losses import angle_loss
#@timing_decorator
#@profile
......@@ -27,6 +28,14 @@ def train_loop(dataloader, model, loss_fn, optimizer):
# Compute prediction and loss
pred = model(X)
loss = loss_fn(pred, y)
print(f"y vs. pred")
cat = torch.cat((y, pred), dim=1)
print(cat)
print(f"Loss ")
loss_tensor = torch.square(torch.abs(torch.atan2(torch.sin(y - pred), torch.cos(y - pred))))
print(loss_tensor)
# Backpropagation and optimization
optimizer.zero_grad()
loss.backward()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment