Skip to content

Commit

Permalink
Add bias arg to Vitamin GeGLU
Browse files Browse the repository at this point in the history
  • Loading branch information
rwightman committed Dec 29, 2024
1 parent 0d87cae commit e0cacbf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions timm/models/vitamin.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,17 @@ def __init__(
in_features,
hidden_features,
act_layer = 'gelu',
bias = True,
drop = 0.0,
):
super().__init__()
norm_layer = partial(get_norm_layer('layernorm'), eps=1e-6)

self.norm = norm_layer(in_features)
self.w0 = nn.Linear(in_features, hidden_features)
self.w0 = nn.Linear(in_features, hidden_features, bias=bias)
self.act = create_act_layer(act_layer)
self.w1 = nn.Linear(in_features, hidden_features)
self.w2 = nn.Linear(hidden_features, in_features)
self.w1 = nn.Linear(in_features, hidden_features, bias=bias)
self.w2 = nn.Linear(hidden_features, in_features, bias=bias)

def forward(self, x):
x = self.norm(x)
Expand Down

0 comments on commit e0cacbf

Please sign in to comment.