Multi-Class Cross Entropy Loss function implementation in PyTorch

Hi @ptrblck

I ran your U-Net model for around 3300 epochs, but it wasn’t giving good results, and it only learnt how to detect structures (ch1), with the rest being mostly gray or black.

I decided to try and debug it with a single class, that of buildings for ch0. I reconfigured the model with 3-ch input and 1-ch output with a binary cross entropy loss with dice loss function. I trained it for 100 epochs using a batch size of 3, but ch0 predictions are coming up empty. I was expecting at least something, but it was totally blank.

Here is an input image:

Here is the corresponding mask ch0 buildings:

and here is the predictions for ch0, which is mostly empty

I then switched to using a U-Net model from here github:minerva-ml/steppy-toolkit - U-Net

I’m seeing some activations for another test image in ch0 at 20 epochs, but the predictions don’t improve beyond this.