MCPcopy Create free account
hub / github.com/bitsandbytes-foundation/bitsandbytes / FFN

Class FFN

tests/test_functional.py:50–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48
49
50class FFN(torch.nn.Module):
51 def __init__(self, input_features, hidden_size, bias=True):
52 super().__init__()
53 self.fc1 = torch.nn.Linear(input_features, hidden_size, bias=bias)
54 self.fc2 = torch.nn.Linear(hidden_size, input_features, bias=bias)
55
56 with torch.no_grad():
57 torch.nn.init.xavier_uniform_(self.fc1.weight)
58 torch.nn.init.xavier_uniform_(self.fc2.weight)
59
60 def forward(self, x):
61 x = torch.relu(self.fc1(x))
62 x = self.fc2(x)
63 return x
64
65
66class Timer:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected