MCPcopy
hub / github.com/Pointcept/PointTransformerV3 / MLP

Class MLP

model.py:493–516  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

491
492
493class MLP(nn.Module):
494 def __init__(
495 self,
496 in_channels,
497 hidden_channels=None,
498 out_channels=None,
499 act_layer=nn.GELU,
500 drop=0.0,
501 ):
502 super().__init__()
503 out_channels = out_channels or in_channels
504 hidden_channels = hidden_channels or in_channels
505 self.fc1 = nn.Linear(in_channels, hidden_channels)
506 self.act = act_layer()
507 self.fc2 = nn.Linear(hidden_channels, out_channels)
508 self.drop = nn.Dropout(drop)
509
510 def forward(self, x):
511 x = self.fc1(x)
512 x = self.act(x)
513 x = self.drop(x)
514 x = self.fc2(x)
515 x = self.drop(x)
516 return x
517
518
519class Block(PointModule):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected