Skip to content
Snippets Groups Projects
Commit fe2424b7 authored by Daniel CARRON's avatar Daniel CARRON :b:
Browse files

[doc] Various docstring improvements

parent ec656ca4
No related branches found
No related tags found
1 merge request!15Update documentation
Showing
with 31 additions and 31 deletions
......@@ -8,7 +8,7 @@ Preset Configurations
---------------------
This module contains preset configurations for baseline CNN architectures and
datamodules.
DataModules.
.. _mednet.config.models:
......@@ -38,9 +38,9 @@ DataModule support
==================
Base DataModules and raw data loaders for the various databases currently
supported in this package, for your reference. Each pre-configured data module
supported in this package, for your reference. Each pre-configured DataModule
can receive the name of one or more splits as argument to build a fully
functional data module that can be used in training, prediction or testing.
functional DataModule that can be used in training, prediction or testing.
.. autosummary::
:toctree: api/config.datamodules
......@@ -67,7 +67,7 @@ Pre-configured DataModules
DataModules provide access to preset pytorch dataloaders for training,
validating, testing and running prediction tasks. Each of the pre-configured
DataModule is based on one (or more) of the :ref:`supported base data modules
DataModule is based on one (or more) of the :ref:`supported base DataModules
<mednet.config.datamodules>`.
.. autosummary::
......@@ -97,8 +97,8 @@ Cross-validation DataModules
We support cross-validation with precise preset folds. In this section, you
will find the configuration for the first fold (fold-0) for all supported
datamodules. Nine other folds are available for every configuration (from 1 to
9), making up 10 folds per supported datamodule.
DataModules. Nine other folds are available for every configuration (from 1 to
9), making up 10 folds per supported DataModule.
.. autosummary::
......
......@@ -64,6 +64,6 @@ before optionally caching in-memory Sample representations. The "raw" representa
DataModule
----------
A datamodule aggregates Splits and RawDataLoaders to provide lightning a known-interface to the complete evaluation protocol (train, validation, prediction and testing)
A DataModule aggregates Splits and RawDataLoaders to provide lightning a known-interface to the complete evaluation protocol (train, validation, prediction and testing)
required for a full experiment to take place. It automates control over data loading parallelisation and caching inside our framework,
providing final access to readily-usable pytorch DataLoaders.
......@@ -39,7 +39,7 @@ Evaluation
----------
In evaluation, we input predictions to generate performance summaries that help analysis of a trained model.
The generated files are a pdf containing various plots and a table of metrics for each dataset split.
The generated files are a .pdf containing various plots and a table of metrics for each dataset split.
Evaluation is done using the :ref:`evaluate command <mednet.cli>` followed by the json file generated during
the inference step and a threshold.
......
......@@ -25,7 +25,7 @@ Several mapping algorithms are available to choose from, which can be specified
Examples
========
Generates saliency maps for all prediction dataloaders on a datamodule,
Generates saliency maps for all prediction dataloaders on a DataModule,
using a pre-trained pasa model, and saves them as numpy-pickeled
objects on the output directory:
......@@ -53,12 +53,12 @@ Generates visualizations in form of heatmaps from existing saliency maps for a d
Interpretability
----------------
Given a target label, the interpretability step computes the proportional energy and average saliency focus in a datamodule.
Given a target label, the interpretability step computes the proportional energy and average saliency focus in a DataModule.
The proportional energy is defined as the quantity of activation that lies within the ground truth boxes compared to the total sum of the activations.
The average saliency focus is the sum of the values of the saliency map over the ground-truth bounding boxes, normalized by the total area covered by all ground-truth bounding boxes.
This requires a datamodule containing human-annotated bounding boxes.
This requires a DataModule containing human-annotated bounding boxes.
Examples
========
......@@ -72,7 +72,7 @@ Evaluate the generated saliency maps for their localization performance:
Completeness
------------
The saliency completeness script computes ROAD scores of saliency maps and saves them in a JSON file.
The saliency completeness script computes ROAD scores of saliency maps and saves them in a .json file.
The ROAD algorithm estimates the explainability (in the completeness sense) of saliency maps by substituting
relevant pixels in the input image by a local average, re-running prediction on the altered image,
......@@ -82,7 +82,7 @@ the importance of such elements in the produced saliency map.
More information can be found in [ROAD-2022]_.
This requires a datamodule containing human-annotated bounding boxes.
This requires a DataModule containing human-annotated bounding boxes.
Examples
========
......
......@@ -71,12 +71,12 @@ Plotting training metrics
Various metrics are recorded at each epoch during training, such as the execution time, loss and resource usage.
These are saved in a Tensorboard file, located in a `logs` subdirectory of the training output folder.
Mednet provides a :ref:`train-analysis <mednet.cli>` convenience script that graphs the scalars stored in these files and saves them in a pdf file.
Mednet provides a :ref:`train-analysis <mednet.cli>` convenience script that graphs the scalars stored in these files and saves them in a .pdf file.
Examples
========
Generates a pdf file with plots showing the evolution of logged metrics in time:
Generates a .pdf file with plots showing the evolution of logged metrics in time:
.. code:: sh
......
# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Montgomery datamodule for TB detection.
"""Montgomery DataModule for TB detection.
Database reference: [MONTGOMERY-SHENZHEN-2014]_
"""
......@@ -95,7 +95,7 @@ def make_split(basename: str) -> DatabaseSplit:
class DataModule(CachingDataModule):
"""Montgomery datamodule for TB detection.
"""Montgomery DataModule for TB detection.
The standard digital image database for Tuberculosis was created by the National
Library of Medicine, Maryland, USA in collaboration with Shenzhen No.3 People’s
......
# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Montgomery datamodule for TB detection.
"""Montgomery DataModule for TB detection.
Database reference: [MONTGOMERY-SHENZHEN-2014]_
......
# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Montgomery datamodule for TB detection (cross validation fold 0).
"""Montgomery DataModule for TB detection (cross validation fold 0).
Database reference: [MONTGOMERY-SHENZHEN-2014]_
......
# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Montgomery datamodule for TB detection (cross validation fold 1).
"""Montgomery DataModule for TB detection (cross validation fold 1).
Database reference: [MONTGOMERY-SHENZHEN-2014]_
......
# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Montgomery datamodule for TB detection (cross validation fold 2).
"""Montgomery DataModule for TB detection (cross validation fold 2).
Database reference: [MONTGOMERY-SHENZHEN-2014]_
......
# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Montgomery datamodule for TB detection (cross validation fold 3).
"""Montgomery DataModule for TB detection (cross validation fold 3).
Database reference: [MONTGOMERY-SHENZHEN-2014]_
......
# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Montgomery datamodule for TB detection (cross validation fold 4).
"""Montgomery DataModule for TB detection (cross validation fold 4).
Database reference: [MONTGOMERY-SHENZHEN-2014]_
......
# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Montgomery datamodule for TB detection (cross validation fold 5).
"""Montgomery DataModule for TB detection (cross validation fold 5).
Database reference: [MONTGOMERY-SHENZHEN-2014]_
......
# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Montgomery datamodule for TB detection (cross validation fold 6).
"""Montgomery DataModule for TB detection (cross validation fold 6).
Database reference: [MONTGOMERY-SHENZHEN-2014]_
......
# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Montgomery datamodule for TB detection (cross validation fold 7).
"""Montgomery DataModule for TB detection (cross validation fold 7).
Database reference: [MONTGOMERY-SHENZHEN-2014]_
......
# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Montgomery datamodule for TB detection (cross validation fold 8).
"""Montgomery DataModule for TB detection (cross validation fold 8).
Database reference: [MONTGOMERY-SHENZHEN-2014]_
......
# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Montgomery datamodule for TB detection (cross validation fold 9).
"""Montgomery DataModule for TB detection (cross validation fold 9).
Database reference: [MONTGOMERY-SHENZHEN-2014]_
......
......@@ -10,7 +10,7 @@ from ..shenzhen.datamodule import make_split as make_shenzhen_split
class DataModule(ConcatDataModule):
"""Aggregated datamodule composed of Montgomery and Shenzhen datasets."""
"""Aggregated DataModule composed of Montgomery and Shenzhen datasets."""
def __init__(self, split_filename: str):
montgomery_loader = MontgomeryLoader()
......
# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated datamodule composed of Montgomery and Shenzhen datasets (default
"""Aggregated DataModule composed of Montgomery and Shenzhen datasets (default
split).
See :py:class:`.montgomery_shenzhen.datamodule.DataModule` for technical details.
......
# SPDX-FileCopyrightText: Copyright © 2023 Idiap Research Institute <contact@idiap.ch>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Aggregated datamodule composed of Montgomery and Shenzhen datasets (cross
"""Aggregated DataModule composed of Montgomery and Shenzhen datasets (cross
validation fold 0).
See :py:class:`.montgomery_shenzhen.datamodule.DataModule` for technical details.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment