Get the number of parameters in the MLP linear layers, including the intermediate and output matrices. Returns: int: the number of parameters in the two MLP linear layers
(self)
| 276 | self.model_config.n_head) |
| 277 | |
| 278 | def get_num_params_per_layer_mlp(self) -> int: |
| 279 | """Get the number of parameters in the MLP linear layers, including the |
| 280 | intermediate and output matrices. |
| 281 | |
| 282 | Returns: |
| 283 | int: the number of parameters in the two MLP linear layers |
| 284 | """ |
| 285 | return 2 * self.model_config.hidden_dim * self.model_config.ffn_embed_dim * self.model_config.moe_num_experts |
| 286 | |
| 287 | def get_num_params_per_layer_router(self) -> int: |
| 288 | if self.model_config.moe_num_experts > 1: |
no outgoing calls
no test coverage detected