How to initialize sample weights for multi-class segmentation?
问题 I'm working on multi-class segmentation using Keras and U-net. I have as output of my NN 12 classes using soft max Activation function. the shape of my output is (N,288,288,12). to fit my model I use sparse_categorical_crossentropy. I want to initialize weights of my model for my unbalanced dataset. I found this useful link and try it to implement it; since class_weight in Keras does not work for more than 2 classes, I used sample weights My code is : inputs = tf.keras.layers.Input((IMG_WIDHT