MCPcopy Create free account
hub / github.com/buaacxf/VIPTR / __init__

Method __init__

modules/VIPTRv1.py:316–328  ·  view source on GitHub ↗
(self, in_dim, hidden_dim, out_chans=None, act_layer=nn.GELU, dropout=0.)

Source from the content-addressed store, hash-verified

314
315class FeedForward(nn.Module):
316 def __init__(self, in_dim, hidden_dim, out_chans=None, act_layer=nn.GELU, dropout=0.):
317 super().__init__()
318
319 out_chans = out_chans or in_dim
320 hidden_dim = hidden_dim or in_dim
321
322 self.net = nn.Sequential(
323 nn.Linear(in_dim, hidden_dim),
324 act_layer(),
325 nn.Dropout(dropout),
326 nn.Linear(hidden_dim, out_chans),
327 nn.Dropout(dropout)
328 )
329
330 def forward(self, x):
331 return self.net(x)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected