Граф коммитов

145 Коммитов

Автор SHA1 Сообщение Дата
Peter Hessey c1b363e158
ENH: Move docs to ReadTheDocs (#768)
* 📝Move docs folder to sphinx-docs

* Trigger build for new URL

* 📝 Fix build to include README + CHANGLOG

* 📝 Add back in link fixing

* 🐛 Fix docs links

* 🚨 📝 Fix markdown linting

* 📝 Change relative links to GitHub ones permanently

* 📝 Replace more relative paths

* 📝 Switch to symlinks

* 📝 Replace README in toctree

* 📝 Update README

* 🐛 Attempt to fix images not rendering

* 🐛 Fix broken links

* Remove IDE settings from gitignore

* ️ Move docs to `docs/` and add Makefile back

* 🙈 Update gitignore

* ♻️ ️ Resolve review comments and change theme

* 📝 🔀 Rebase + markdown linting

* 🔥 Remove build files (again)

* 🙈 Remove pieline-breaking symlink

*  Add furo to sphinx dependencies

* 📌 Move sphinx deps to environment.yml + lock

* 📝 Improve doc folder structure

* Return to copying instead of symlink

* 📝 Update indexing and titles

* 📝 Address review comments
2022-08-04 09:15:19 +01:00
Fernando Pérez-García a9fd52c2c9
BUG: Fix missing channels dimension in normalization (#701)
* Fix missing channels dimension in normalization

* Update CHANGELOG

* Add test for 3D and 4D input images

* Move conversion to NumPy array
2022-06-13 13:47:27 +01:00
Fernando Pérez-García 3eaf2f9053
Deprecate manual changelog (#707) 2022-03-29 13:43:50 +01:00
Fernando Pérez-García f1ae24aa69
Update hi-ml submodule (#709) 2022-03-29 08:56:46 +01:00
Jacopo Teneggi b2ae826653
Import submodules to sys.path to fix autodoc's warning (#704) 2022-03-23 21:32:00 +00:00
maxilse 6791dce4c3
Automatically and linearly scale the learning rate of the SSL encoder to the number of GPUS (#667)
The learning rate is now linearly scaled by the number of GPUs available, e.g., lr = 0.001, 8 GPUs are available => lr=0.008.

I tested it for SimCLR and BYOL (https://ml.azure.com/experiments/id/81fa8775-1a25-47ae-9fe7-c13a6b91a421?wsid=/subscriptions/db9fc1d1-b44e-45a8-902d-8c766c255568/resourceGroups/innereyerg/providers/Microsoft.MachineLearningServices/workspaces/innereye4ws&tid=72f988bf-86f1-41af-91ab-2d7cd011db47).

In both cases the results are as expected:

SimCLR: More GPUs give better representations due to larger batches == more negative eaxmples.
BYOL: More GPUs speed up the training but do not give better results.
I did not add any test since we have these two tests already: test_simclr_num_gpus() and test_simclr_num_nodes()
2022-03-22 10:23:39 +00:00
Fernando Pérez-García 45e7d5ff4d
Fix some Sphinx warnings (#699)
* Fix shell lexer name

* Update CHANGELOG

* Fix CHANGELOG

* Fix "html_static_path entry '_static' does not exist"

* Clean up preprocess script

* Fix link to InnerEye-DataQuality

* Use shutil.copy to copy files

* Remove extra info from CHANGELOG

* Fix broken link to LICENSE

* Fix lexer name for YAML

* Remove colons from headers

* Fix InnerEye module not being found
2022-03-22 09:46:15 +00:00
Jacopo Teneggi 95d8b72ae6
Specify `formatter_class=argparse.ArgumentDefaultsHelpFormatter` in `generic_parsing.py` to show default values for arguments in help message (#689) 2022-03-15 17:27:01 +00:00
Anton Schwaighofer f0d2337d1b
Improve setup for running the HelloWorld model in AzureML (#693) 2022-03-15 14:07:28 +00:00
Fernando Pérez-García 63fb8688b0
Update TorchIO version (#677)
* Update TorchIO version

Resolves #672.
2022-03-14 16:50:29 +00:00
Fernando Pérez-García d929ccbd46
Ensure the shape of input patches is compatible with model constraints (#682)
* Ensure patches shape is compatible with model constraints

* Remove test for images that are too small
2022-03-10 17:01:25 +00:00
Javier 3c919dca14
Replace data quality folder with a link to the commit (#692)
* Move to commit link

* Remove build

* Update paper link

* Update README

* Add changelog
2022-03-10 09:14:25 +00:00
Javier 1606729c7a
Clean up legacy code (#671)
* Remove rnns

* Fix flake8

* Edit README

* Edit README

* Remove sequence

* Remove sequence

* Fix all

* Remove more

* Remove ignore

* Fix tests

* Undo config

* Fix config

* Revert pycharm

* Fix tests

* Undo outputlogger

* Fix flake8

* Fix ignore file

* Revert hi-ml

* Disable fail on alert
2022-03-09 14:53:12 +00:00
Fernando Pérez-García 8a78ec8c1e
Pad model outputs if they are smaller than the inputs (#681) 2022-03-09 13:32:26 +00:00
Fernando Pérez-García b1f3ef54d6
Fix missing separator error in docs Makefile (#683) 2022-03-07 18:00:34 +00:00
Fernando Pérez-García 6b62d8cbcd
Print out name of log level, not only the number (#678) 2022-03-07 10:11:47 +00:00
Harshita Sharma 501f3920c6
Add FP and TN to DeepMIL outputs and configure outputs for multi-class classification (#679) 2022-03-04 16:16:49 +00:00
Daniel Coelho de Castro e984554c9e
Fix DeepMIL metrics bug (#674)
* Fix DeepMIL metrics input bug

* Add first version of metrics tests

* Update submodule

* Add test for DeepMIL metrics inputs

* Clean-up and update submodule

* Update changelog

* Upgrade mlflow due to Component Governance warning
2022-03-01 10:10:13 +01:00
Fernando Pérez-García d7e5d8b5e5
Replace RadIO with TorchIO for patch-based inference (#666)
* Replace RadIO with TorchIO

* Ensure patches are float32 for forward pass

* Update changelog

* Ignore some types to fix mypy errors

* Remove APEX from conda environment in docs example

Co-authored-by: Javier <jaalvare@microsoft.com>
2022-02-23 10:28:11 +00:00
Daniel Coelho de Castro e2ec5cc839
Add subsampling transform and mean pooling (#656)
* Add subsampling transform

* Add option to allow_missing_keys for Subsampled

* Add dropout param to BaseMIL

* Add docstring and tests for Subsampled

* Update changelog

* Update to hi-ml with mean pooling

* Enable mean pooling in DeepMIL

* Add/refactor mean pooling tests

* Update changelog

* Update to latest hi-ml with mean pooling
2022-02-21 11:24:14 +00:00
maxilse 1600ef3ddf
Fix DeepMIL for TCGA CRCK dataset (#659)
While we updated DeepMIL for the Panda dataset to work with the latest changes, we did not update DeepMIL for the TCGA CRCK dataset.

This PR updates how the caching of the encoded tiles is done and how the checkpoints of the DeepMIL model is saved and loaded.

No additional tests are required since these are the same functions that we use for the Panda dataset. For all of them a test already exists.

Last, the PR updates the cudatoolkit version, Anton and I found that this is the root cause for all our problems with ddp
2022-02-16 09:50:59 +00:00
Harshita Sharma 914a89383d
Enable fine-tuning in Deepmil (#650) 2022-02-09 10:01:57 +00:00
Daniel Coelho de Castro eda76357f0
Add dropout to DeepMIL and fix feature extractor setup (#653)
* Add dropout to DeepMILModule, with param in BaseMIL
* Fix feature extractor setup for torchvision models
2022-02-07 13:09:04 +00:00
Anton Schwaighofer d617c8107c
Re-enable Linux build (#655)
Also refactored tests that caused test discovery to slow down
2022-02-04 15:41:42 +00:00
Anton Schwaighofer a6b15166b7
Fix for stuck Linux build: Move pytest to Windows (#652)
Also renamed many build legs so that they can be found more easily in the UI.
2022-02-04 11:20:03 +00:00
maxilse b8fe0eb2f1
Fix in _convert_to_tensor_if_necessary so that also np.array get converted correctly (#649) 2022-02-01 14:53:41 +00:00
Anton Schwaighofer 4fdeed23e4
Workaround for bug in PL 1.5.5: CombinedLoader cannot be used with DDP for training data (#646)
Fix for https://github.com/PyTorchLightning/pytorch-lightning/issues/11632
2022-02-01 14:25:21 +00:00
Harshita Sharma 710bc3661e
Add class-wise metrics logging and confusion matrix to DeepMIL (#647) 2022-02-01 13:13:07 +00:00
vale-salvatelli fb258d5c9a
Enabling DeepSMILE on large encoded datasets (#637)
This PR contains two changes necessary to run DeepSMILE on a large dataset when using the Innereye SSL checkpoint (or any other encoder with high dimension): 1 -option to encode in chunks (this prevents OOM error when performing the encoding) 2 -option to load the cached encoded dataset in CPU (this prevents OOM when loading from the cache)
It also changes how the PNG images are loaded all over the histo pipeline to make the loading faster (see https://hi-ml.readthedocs.io/en/latest/loading_images.html)
2022-01-25 10:31:06 +00:00
Anton Schwaighofer 61d9cab5cc
Cancel queued AzureML jobs when starting a PR build (#640)
AzureML jobs from failed previous PR builds do not get cancelled, consuming excessive resources. Now kill all queued and running jobs before starting new ones.
2022-01-25 09:07:18 +00:00
maxilse 6a4919c361
SimCLR recovery test (#643) 2022-01-24 18:56:54 +00:00
Harshita Sharma 884e3fd7dc
Panda SSL tile selection and binary evaluation (#635)
* panda tile selection and binary label

* changelog

* PR comments

* flake8 errors

* remove reset_index

* update pillow and ipython

Co-authored-by: t-hsharma <t-hsharma@microsoft.com>
2022-01-24 15:10:40 +00:00
Anton Schwaighofer 56ee8b67b5
Fix length problem in SSL Cosine LR (#638)
SimCLR cosine LR scheduler was getting wrong length information when the linear head dataset was longer than the encoder dataset. Also, removed lots of obsolete pytest.skipif.is_windows() annotations.
2022-01-21 15:02:02 +00:00
Harshita Sharma 0b8fe32b38
Plotting heatmap and thumbnails for test PANDA slides (#634)
* heatmap and thumbnail output, deepmil module for panda

* deepmil module panda subclass

* heatmap of selected tiles with correct location

* scaled and shifted rectangle coordinates

* slide dataset at container level

* Instantiate dataset class in basemil

* dataset paths for AML

* heatmap utils selected

* fix mypy and flake8 errors

* mypy error resolved

* address PR comments

* flake8 errors resolved

* PR comments addressed

* add test for plots

* PR comments more

* test for heatmap

* tests for heatmap

* add file comparison plot tests

* reverting test_dict values for other test with hardcoded values

* PR comments Valentina

* PR comments

* change colormap to reds

* remove redundant for loop

Co-authored-by: t-hsharma <t-hsharma@microsoft.com>
2022-01-19 07:08:12 +00:00
Anton Schwaighofer ccb53d01ad
Improve recovery of preempted jobs (#633)
Autosaving checkpoints by default every 1 epoch to a fixed file name. Retiring the "top k" recovery checkpoint notion because that was tied to specific models that needed more than 1 checkpoint.
2022-01-17 12:05:39 +00:00
vale-salvatelli 25db288768
fixing PandaInnereyeSSLMIL (#625)
* fixing PandaInnereSSLMIL
* update hi-ml to latest version (include checkpoint downloader fix and new augmentations)
2022-01-11 17:54:36 +00:00
Anton Schwaighofer 015e9e4829
Moving nii.gz from git lfs to git to simplify the HelloWorld test (#632) 2022-01-11 16:19:17 +00:00
Anton Schwaighofer 1523882e82
Upgrade to PyTorch 1.10 (#585) 2022-01-10 08:59:59 +00:00
Anton Schwaighofer ac6a3128df
SSL Online evaluator: save checkpoints without DDP wrapper (#623) 2022-01-06 14:54:34 +00:00
Anton Schwaighofer e761af0e2f
Bug fix: SSL on multiple nodes used wrong LR scheduler (#628) 2022-01-06 14:12:26 +00:00
Daniel Coelho de Castro 6a4d334a99
Enable tiling non-PANDA WSI datasets (#621)
* Add basic dataset and environment changes

* Add loading/preproc utils

* Back-up PANDA tiling scripts

* Refactor and generalise tiling scripts

* Remove Azure scripts

* Add test WSI file

* Add preprocessing tests

* Update changelog

* Add Linux condition for cuCIM in environment.yml

* Use PANDA instead of TCGA-PRAD in test

* Leave TcgaPradDataset as an example

* Fix skipped InnerEye dataset tests

* Create and test mock slides dataset

* Remove Tests/ML/datasets from pytest discovery
2021-12-16 16:11:55 +00:00
Anton Schwaighofer 276e0f5253
Bug fix: multi-GPU jobs on a VM use wrong folders (#622)
Co-authored-by: Shruthi42 <13177030+Shruthi42@users.noreply.github.com>
2021-12-15 17:25:42 +00:00
Anton Schwaighofer e477c9dd83
Upgrade to Pytorch Lightning 1.5.5 (#591) 2021-12-15 10:48:35 +00:00
vale-salvatelli 4aa84b9f36
Vsalva/deepmil panda (#619)
* adding deepmilpanda container
2021-12-14 19:45:07 +00:00
Anton Schwaighofer 212e65c4a3
Adding pipeline cache for conda environment (#618)
Add cache that re-uses the full Conda environment
2021-12-14 12:49:20 +00:00
Anton Schwaighofer 7a36c5980d
Simplify setting callbacks in LightningContainers (#617)
- Callbacks presently need to be specified via trainer kwargs, which is cumbersome. Introduce a callbacks method.
- Add a flag to control how often validation happens
2021-12-13 13:26:44 +00:00
Anton Schwaighofer f58c457e80
Small cleanups for checkpoint loading (#615) 2021-12-13 12:05:24 +00:00
mebristo 0522d84bd4
Add more histopathology configs (#616)
* Add histo configs

* Update changelog

* mypy

* Add copyright statements

* Move copyright notice misplaced by pycharm

* Move copyright notice misplaced by pycharm

* Update pycharm mappings
2021-12-11 00:08:29 +00:00
Anton Schwaighofer 46017f40a0
Enabling distributed training for SSL online evaluator (#612) 2021-12-10 09:33:59 +00:00
Anton Schwaighofer c7eef5ea69
Downloading checkpoints from AML if not found on disk (#614)
Workaround for a temporary issue with low-priority preemption: checkpoint files are not available on disk upon job restart. Trying to download from AML.
2021-12-09 20:18:41 +00:00