MCPcopy Create free account
hub / github.com/apple/axlearn / _create_layer_parameter_specs

Method _create_layer_parameter_specs

axlearn/common/bert.py:158–167  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

156 )
157
158 def _create_layer_parameter_specs(self) -> dict[str, ParameterSpec]:
159 cfg = self.config
160 return dict(
161 # Output layer weights are shared with encoder, but bias is a separate parameter.
162 output_bias=ParameterSpec(
163 shape=[cfg.num_classes],
164 mesh_axes=(None,),
165 initializer=constant_initializer(0.0),
166 ),
167 )
168
169 def forward(self, input_batch: NestedTensor) -> Tensor:
170 """Produces prediction scores from BERT output features.

Callers

nothing calls this directly

Calls 2

ParameterSpecClass · 0.90
constant_initializerFunction · 0.90

Tested by

no test coverage detected