about input fourier features.
lzhbrian opened this issue · 0 comments
lzhbrian commented
Hi, thanks for the work. I have a question regarding the input fourier features.
I think you might have included the margin into the target canvas (-0.5~0.5) ?
That makes the input frequencies become relatively lower.
alias-free-gan-pytorch/model.py
Lines 193 to 199 in d1a4c52
A possible fix would be something like:
class FourierFeature(nn.Module):
def __init__(self, size=16, margin=10, dim=512, cutoff=2, eps=1e-8):
"""
size: sampling rate (or feature map size)
margin: expanded feature map margin size
dim: # channels
cutoff: cutoff fc
"""
super().__init__()
normalized_margin = margin / size
# -0.5-m ~ 0.5+m, uniform interplate 'size' (except the last one)
# note the margin here, target canvas was -0.5~0.5, extended canvas should be larger
coords = torch.linspace(- 0.5 - normalized_margin,
0.5 + normalized_margin,
size + 2 * margin + 1)[:-1]