so if that’s correct, how can i pass weighted values to the loss function for each of the sub-network, since the labels are different for each of the sub-networks. Do i have to call nn.CrossEntropy(weights) each time when i calculate the loss ? so something like this:
criterion = nn.CrossEntropyLoss(weights_label_0)
loss_1 = criterion(output[0], label_0)

criterion = nn.CrossEntropyLoss(weights_label_1)
loss_2 = criterion(output[1], label_1)

criterion = nn.CrossEntropyLoss(weights_label_2)
loss_3 = criterion(output[2], label_2)

loss = loss_1+loss_2+loss_3
loss.backward()
optimizer.step()

will calling nn.CrossEntropyLoss() every time before calculating loss will mess up the backpropogation somehow?