Time2Vec-PyTorch
Time2Vec-PyTorch copied to clipboard
Why Linear output is 2 for Model
Can you please explain why we have got 2 dim for fc output in Model.py. ?
Hello, I have the same question, do you know the result of the question?
I'll guess that is because he uses nn.CrossEntropyLoss() for the binary classification in the toy dataset. In my opinion, this should be a parameter you can set (see below), so that you can use the model also in a non-binary target setting.
class Model(nn.Module):
def __init__(self, activation, hiddem_dim, out_dim):
super(Model, self).__init__()
if activation == "sin":
self.l1 = SineActivation(1, hiddem_dim)
elif activation == "cos":
self.l1 = CosineActivation(1, hiddem_dim)
self.fc1 = nn.Linear(hiddem_dim, out_dim)