eragonruan / refinenet-image-segmentation

a tensorflow implement of refinenet ,RefineNet: Multi-Path Refinement Networks for High-Resolution Semantic Segmentation
130 stars 35 forks source link

Weighted Cross Entropy loss function #10

Open Jorisfournel opened 6 years ago

Jorisfournel commented 6 years ago

Hi, First thank you for this implementation. I didn't test it yet but I'm about to, for custom data, a 3 classes segmentation task, where implementing a weighted cross entropy function should be determinant. What changes in the code should be done to do that ? (I don't master tf yet, I worked on caffe before, a tip would be gratefuly taken)

Thanks in advance !

eragonruan commented 6 years ago

@Jorisfournel in nets/model.py, you should modify this function. tf provide weighted cross entropy api, you can find it here