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

Method __init__

modules/VIPTRv2.py:309–321  ·  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

307
308class FeedForward(nn.Module):
309 def __init__(self, in_dim, hidden_dim, out_chans=None, act_layer=nn.GELU, dropout=0.):
310 super().__init__()
311
312 out_chans = out_chans or in_dim
313 hidden_dim = hidden_dim or in_dim
314
315 self.net = nn.Sequential(
316 nn.Linear(in_dim, hidden_dim),
317 act_layer(),
318 nn.Dropout(dropout),
319 nn.Linear(hidden_dim, out_chans),
320 nn.Dropout(dropout)
321 )
322
323 def forward(self, x):
324 return self.net(x)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected