Skip to content

Commit

Permalink
add layer with bias None to test
Browse files Browse the repository at this point in the history
  • Loading branch information
itai-berman committed Nov 20, 2024
1 parent fbf4b7e commit 4875995
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ class LinearFNet(torch.nn.Module):
def __init__(self):
super(LinearFNet, self).__init__()
self.fc1 = torch.nn.Linear(in_features=1000, out_features=100, bias=False)
self.fc2 = torch.nn.Linear(in_features=100, out_features=10, bias=True)
self.fc2 = torch.nn.Linear(in_features=100, out_features=50, bias=True)
self.fc3 = torch.nn.Linear(in_features=50, out_features=10, bias=False)

def forward(self, x):
x = F.linear(x, self.fc1.weight, self.fc1.bias)
y = F.linear(x, bias=self.fc2.bias, weight=self.fc2.weight)
x = F.linear(x, bias=self.fc2.bias, weight=self.fc2.weight)
y = F.linear(x, self.fc3.weight, bias=None)
return y


Expand Down

0 comments on commit 4875995

Please sign in to comment.