Basic_CNNs_TensorFlow2 icon indicating copy to clipboard operation
Basic_CNNs_TensorFlow2 copied to clipboard

Assign different gradient weights

Open Cris-chen opened this issue 5 years ago • 1 comments
trafficstars

How to write the code to assign different gradient weights to different classes of SparseCategoricalCrossentropy

Cris-chen avatar Oct 15 '20 17:10 Cris-chen

The sample_weight param may work. https://tensorflow.google.cn/api_docs/python/tf/keras/losses/SparseCategoricalCrossentropy#call

calmiLovesAI avatar Oct 14 '21 05:10 calmiLovesAI