Skip to content

Commit

Permalink
Add Binary Dice Loss (#138)
Browse files Browse the repository at this point in the history
* binary dice loss

* gather on class ids

* add test

* fix imports

* update tests.yml and req.txt

* fix typo

* fix typo

* fix tests

* update docstrings
  • Loading branch information
DavidLandup0 committed May 29, 2023
1 parent 14e2738 commit 7e0a05c
Show file tree
Hide file tree
Showing 9 changed files with 539 additions and 7 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install black isort pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
- name: Black and isort
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
bash scripts/format.sh
- name: Test with pytest
run: |
pytest
1 change: 1 addition & 0 deletions deepvision/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from deepvision import datasets
from deepvision import evaluation
from deepvision import losses
from deepvision import models

__version__ = "0.1.6"
2 changes: 1 addition & 1 deletion deepvision/layers/patching_and_embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def PatchingAndEmbedding(
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
by Alexey Dosovitskiy et al. (https://arxiv.org/abs/2010.11929)
Acknowledgements and other implementations:
Acknowledgements and other implementations:
- The TensorFlow layer was originally implemented by David Landup for KerasCV.
- HuggingFace's implementations: https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/modeling_vit.py
and https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit/modeling_tf_vit.py
Expand Down
1 change: 1 addition & 0 deletions deepvision/losses/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from deepvision.losses.dice.binary_dice import BinaryDiceLoss
Empty file.
Loading

0 comments on commit 7e0a05c

Please sign in to comment.