microsoft / hi-ml

HI-ML toolbox for deep learning for medical imaging and Azure integration
https://aka.ms/hi-ml
MIT License
269 stars 60 forks source link

BUG: DeepMIL model uses training data even when running in eval mode #889

Closed ant0nsc closed 1 year ago

ant0nsc commented 1 year ago

Instantiating the DeepMIL classifier in create_model always relies on the training dataset and module, which is not available when doing evaluation. This PR makes that more flexible and allows to hardcode the number of classes to use for evaluation.

codecov[bot] commented 1 year ago

Codecov Report

Merging #889 (b263152) into main (26ff7d0) will increase coverage by 1.46%. The diff coverage is 90.32%.

Impacted file tree graph

Flag Coverage Δ
hi-ml 83.29% <100.00%> (+0.01%) :arrow_up:
hi-ml-azure 27.10% <100.00%> (+0.10%) :arrow_up:
hi-ml-cpath 76.07% <88.00%> (+2.93%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...src/health_cpath/configs/classification/BaseMIL.py 87.50% <88.00%> (+4.16%) :arrow_up:
hi-ml-azure/src/health_azure/himl.py 41.32% <100.00%> (ø)
hi-ml/src/health_ml/lightning_container.py 80.34% <100.00%> (+0.16%) :arrow_up:
hi-ml/src/health_ml/runner_base.py 88.46% <100.00%> (+0.11%) :arrow_up:
hi-ml/src/health_ml/utils/split_dataset.py 63.63% <100.00%> (ø)

... and 11 files with indirect coverage changes