hello everyone,
I am using a segmentation mask, and it gives me output in shape of BxCxHxW, where C is the number of classes.
During my training I only want to optimize for class k where k can be a number  between 0 to C. So basically I want to only update the model for that specific channel and I dont care about the other channels. in my optimization I use L1 loss to force the k channel to be equal a mask.
Currently, I select my channel via output[:,k] so I will have L1Loss(output[:,k],mask), where output[:,k] and mask both has shape of BxHxW.
But it seems like something is not working okay. in my output I see that the other channels also get updated , so I assume something is wrong.
I was wondering if someone has a suggestion on how to mask or select a specific channel of  output in a correct way