MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / __init__

Method __init__

SwissArmyTransformer/examples/yolos/models/detector.py:22–26  ·  view source on GitHub ↗
(self, input_dim, hidden_dim, output_dim, num_layers)

Source from the content-addressed store, hash-verified

20 """ Very simple multi-layer perceptron (also called FFN)"""
21
22 def __init__(self, input_dim, hidden_dim, output_dim, num_layers):
23 super().__init__()
24 self.num_layers = num_layers
25 h = [hidden_dim] * (num_layers - 1)
26 self.layers = nn.ModuleList(nn.Linear(n, k) for n, k in zip([input_dim] + h, h + [output_dim]))
27
28 def forward(self, x):
29 for i, layer in enumerate(self.layers):

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected