Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

DOC: Add all InnerEye/ML docstrings to ReadTheDocs #783

Merged
merged 23 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
267d4e8
📝 Create basic for ML API
peterhessey Aug 5, 2022
806f261
📝 Add ML/configs base doc files
peterhessey Aug 5, 2022
0cbd7c7
📝 Finish ML/configs API
peterhessey Aug 8, 2022
f5c82cf
📝 Update augmentations
peterhessey Aug 8, 2022
ac0171a
📝 Add ML/dataset API docs
peterhessey Aug 8, 2022
e9fff6a
📝 Add rst skeleton for ML/models
peterhessey Aug 8, 2022
4fd8de4
📝 Fix docstring missing newlines
peterhessey Aug 8, 2022
6371548
Remove script
peterhessey Aug 8, 2022
27e7784
📝 Finish ML/models API docs
peterhessey Aug 8, 2022
6a1273f
📝 Start ML/SSL API. Fix some formatting issues
peterhessey Aug 9, 2022
562173b
📝 Correct whitespace issues in `:param`
peterhessey Aug 9, 2022
416e907
📝 Fix whitespace errors on `:return` statements
peterhessey Aug 9, 2022
a778dac
📝 Fix :return: statements
peterhessey Aug 9, 2022
33b557c
📝 Finish ML/SSL API
peterhessey Aug 9, 2022
7d4f466
📝 Add ML/utils API docs
peterhessey Aug 9, 2022
19ab5b2
📝 Add visualizer docs, fix `:raise` indents
peterhessey Aug 9, 2022
67169af
📝 Fix more issues with the `:raises:` formatting
peterhessey Aug 9, 2022
7619004
♻️ Restructuring folders
peterhessey Aug 9, 2022
bdc2a51
📝 Limit API `toctree` depth
peterhessey Aug 9, 2022
56c3a52
📝 Add primary InnerEye/ML files API to docs
peterhessey Aug 9, 2022
e9e5ee8
📝 Fix and add `InnerEye/ML/*.py` docs
peterhessey Aug 9, 2022
c1d84a8
⚰️ Remove weird `settings.json` change
peterhessey Aug 9, 2022
9f57a6a
♻️ 💡 Address review comments
peterhessey Aug 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
📝 Start ML/SSL API. Fix some formatting issues
  • Loading branch information
peterhessey committed Aug 9, 2022
commit 6a1273f2a7abb60a97a5bc6964a505e997a9e4ce
6 changes: 3 additions & 3 deletions InnerEye/ML/SSL/datamodules_and_datasets/transforms_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ def get_ssl_transforms_from_config(config: CfgNode,
are called on. If False, simply return one transformed version of the sample centered and cropped.

:param use_training_augmentations_for_validation: If True, use augmentation at validation time too.
This is required for SSL validation loss to be meaningful. If False, only apply basic processing step
(no augmentations)
This is required for SSL validation loss to be meaningful. If False, only apply basic processing step
(no augmentations)

:param expand_channels: if True the expand channel transformation from InnerEye.ML.augmentations.image_transforms
will be added to the transformation passed through the config. This is needed for single channel images as CXR.
will be added to the transformation passed through the config. This is needed for single channel images as CXR.
"""
train_transforms = create_transforms_from_config(config, apply_augmentations=True,
expand_channels=expand_channels)
Expand Down
3 changes: 1 addition & 2 deletions InnerEye/ML/models/architectures/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,7 @@ def generate_model_summary(self, crop_size: Optional[TupleInt3] = None,
When called again with the same crop_size, the summary is not created again.

:param crop_size: The crop size for which the summary should be created. If not provided,
the minimum allowed crop size is used.

the minimum allowed crop size is used.
:param log_summaries_to_files: whether to write the summary to a file
"""
if crop_size is None:
Expand Down
3 changes: 2 additions & 1 deletion InnerEye/ML/models/architectures/unet_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ class UNetDecodeBlock(torch.nn.Module):

:param channels: A tuple containing the number of input and output channels
:param upsample_kernel_size: Spatial support of upsampling kernels. If an integer is provided, the same value
will be repeated for all three dimensions. For non-cubic kernels please pass a list or tuple with three elements
will be repeated for all three dimensions. For non-cubic kernels please pass a list or tuple with three
elements.

:param upsampling_stride: Upsamling factor used in deconvolutional layer. Similar to the `upsample_kernel_size`
parameter, if an integer is passed, the same upsampling factor will be used for all three dimensions.
Expand Down
8 changes: 4 additions & 4 deletions InnerEye/ML/pipelines/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ def create_from_checkpoint(path_to_checkpoint: Path,
If there is no checkpoint file for the given epoch, return None.

:param path_to_checkpoint: The path to the checkpoint that we want to load
model_config.checkpoint_folder

model_config.checkpoint_folder
:param model_config: Model related configurations.
:param pipeline_id: Numeric identifier for the pipeline (useful for logging when ensembling)
:return InferencePipeline: an instantiated inference pipeline instance, or None if there was no checkpoint
file for this epoch.

:returns InferencePipeline: an instantiated inference pipeline instance, or None if there was no checkpoint
file for this epoch.
"""
if not path_to_checkpoint.is_file():
# not raising a value error here: This is used to create individual pipelines for ensembles,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# The theme to use for HTML and HTML Help pages. See the documentation fora
# a list of builtin themes.
#
html_theme = 'furo'
Expand Down
26 changes: 26 additions & 0 deletions docs/source/rst/api/ML/SSL/datamodules_and_datasets/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
SSL Datamodules and Datasets
============================

Datasets
----------

.. automodule:: InnerEye.ML.SSL.datamodules_and_datasets.cifar_datasets

.. automodule:: InnerEye.ML.SSL.datamodules_and_datasets.cxr_datasets


Dataset Class Utils
--------------------

.. automodule:: InnerEye.ML.SSL.datamodules_and_datasets.dataset_cls_utils

Datamodules
-----------

.. automodule:: InnerEye.ML.SSL.datamodules_and_datasets.datamodules


Transformation Utils
--------------------

.. automodule:: InnerEye.ML.SSL.datamodules_and_datasets.transforms_utils
10 changes: 8 additions & 2 deletions docs/source/rst/api/ML/SSL/index.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
SSL
===
Self-Supervised Learning (SSL)
==============================

.. toctree::
lightning_containers/index
lightning_modules/index
datamodules_and_datasets/index
utils/index
2 changes: 2 additions & 0 deletions docs/source/rst/api/ML/SSL/lightning_containers/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SSL Lightning Containers
========================
2 changes: 2 additions & 0 deletions docs/source/rst/api/ML/SSL/lightning_modules/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SSL Lightning Modules
=====================
2 changes: 2 additions & 0 deletions docs/source/rst/api/ML/SSL/utils/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SSL Utils
==========
7 changes: 0 additions & 7 deletions docs/source/rst/api/ML/configs.rst

This file was deleted.

4 changes: 3 additions & 1 deletion docs/source/rst/api/ML/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Machine learning
models/index
dataset/index
augmentations/index
pipelines/index
SSL/index
utils/index
runner
photometric_normalization
pipelines
8 changes: 0 additions & 8 deletions docs/source/rst/api/ML/pipelines.rst

This file was deleted.

11 changes: 11 additions & 0 deletions docs/source/rst/api/ML/pipelines/index.rst
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
Pipelines
=========

Inference
---------

.. automodule:: InnerEye.ML.pipelines.inference

.. automodule:: InnerEye.ML.pipelines.scalar_inference

Enesemble
---------
.. automodule:: InnerEye.ML.pipelines.ensemble