Skip to content
Snippets Groups Projects
Commit 1c0bd6f6 authored by Glenn Jocher's avatar Glenn Jocher
Browse files

single_target

parent b6ed1104
No related branches found
No related tags found
No related merge requests found
......@@ -159,7 +159,7 @@ def build_targets(p, targets, model):
g = 0.5 # bias
off = torch.tensor([[0, 0],
[1, 0], [0, 1], [-1, 0], [0, -1], # j,k,l,m
# [1, 0], [0, 1], [-1, 0], [0, -1], # j,k,l,m
# [1, 1], [1, -1], [-1, 1], [-1, -1], # jk,jm,lk,lm
], device=targets.device).float() * g # offsets
......@@ -181,8 +181,8 @@ def build_targets(p, targets, model):
gxi = gain[[2, 3]] - gxy # inverse
j, k = ((gxy % 1. < g) & (gxy > 1.)).T
l, m = ((gxi % 1. < g) & (gxi > 1.)).T
j = torch.stack((torch.ones_like(j), j, k, l, m))
t = t.repeat((5, 1, 1))[j]
j = torch.stack((torch.ones_like(j),))
t = t.repeat((off.shape[0], 1, 1))[j]
offsets = (torch.zeros_like(gxy)[None] + off[:, None])[j]
else:
t = targets[0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment