super(MixtureOfExperts, self).__init__() self.experts = nn.ModuleList([ExpertModel(input_dim) for _ in range(num_experts)]) self.gating_network = nn.Sequential( nn.Linear(input_dim, num_experts), nn.Softmax(dim=1) ) def forward(self, x): expert_outputs = [expert(x) for expert ...