I’m not sure what are you trying to achieve by log over ce loss
With regular training you are minimizing ce loss, mean or sum doesn’t matter that much, bcs in the end increased scale will be compensated by smaller model weights.
But by applying log, your new minimum will be achieved if ce loss = 1/N, bcs log(1)=0