My understanding of class weights in categorical cross entropy is captured by the following expression
where the sum if over samples.
Assuming