MCPcopy Create free account
hub / github.com/microsoft/Cream / __init__

Method __init__

TinyViT/models/tiny_vit.py:194–203  ·  view source on GitHub ↗
(self, in_features, hidden_features=None,
                 out_features=None, act_layer=nn.GELU, drop=0.)

Source from the content-addressed store, hash-verified

192
193class Mlp(nn.Module):
194 def __init__(self, in_features, hidden_features=None,
195 out_features=None, act_layer=nn.GELU, drop=0.):
196 super().__init__()
197 out_features = out_features or in_features
198 hidden_features = hidden_features or in_features
199 self.norm = nn.LayerNorm(in_features)
200 self.fc1 = nn.Linear(in_features, hidden_features)
201 self.fc2 = nn.Linear(hidden_features, out_features)
202 self.act = act_layer()
203 self.drop = nn.Dropout(drop)
204
205 def forward(self, x):
206 x = self.norm(x)

Callers 10

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected