keras-team / keras-contrib

Keras community contributions
MIT License
1.58k stars 650 forks source link

Added dice_loss in keras_contrib/losses with docstring and pytest functionality #524

Open soymintc opened 4 years ago

soymintc commented 4 years ago

- What I did Added Dice coefficient loss function with documentation in keras_contrib/losses, and modified keras_contrib/losses/init.py accordingly Added pytest functionality

- How I did it Added dice_loss function in keras_contrib/losses/dice.py, and verified it using pytest. Testing script is added in tests/keras_contrib/losses/dice_test.py

- How you can verify it

  1. Ran pytest dice_test.py inside tests/keras_contrib/losses, which all passed
  2. Uninstalled the package and re-installed keras_contrib, and re-did step 1, which had no problem.
  3. Ran pytest in the base directory, which didn't result in errors for tests/keras_contrib/losses/dice_test.py

This pull request fixes #484