Skip to content

Commit

Permalink
docs: add cross-references for torch and lightning
Browse files Browse the repository at this point in the history
Additional changes:
* Change `optional` to `default=None` for `train_size` in
  `PCDDataModule` for clarity
  • Loading branch information
adosar committed Jan 25, 2025
1 parent f940127 commit 034eb1c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/aidsorb/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def __call__(self, samples):

class PCDDataset(Dataset):
r"""
``Dataset`` for point clouds.
:class:`~torch.utils.data.Dataset` for point clouds.
Indexing the dataset returns ``(x, None)`` if data are unlabeled, i.e.
``path_to_Y=None``, else ``(x, y)``, where ``x`` and ``y`` are the results of
Expand Down
13 changes: 7 additions & 6 deletions src/aidsorb/datamodules.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@

class PCDDataModule(L.LightningDataModule):
r"""
``LightningDataModule`` for the :class:`~.PCDDataset`.
:class:`~lightning.pytorch.core.LightningDataModule` for the
:class:`~.PCDDataset`.
This datamodule assumes the following directory structure::
Given the following directory structure::
project_root
├── source <-- path_to_X
Expand All @@ -41,8 +42,8 @@ class PCDDataModule(L.LightningDataModule):
├── train.json
└── validation.json
and setups the train, validation, and test datasets, all of which are
instances of :class:`~.PCDDataset`.
train, validation, and test datasets are set up, all of which are instances
of :class:`~.PCDDataset`.
.. note::
For validation and test dataloaders, ``shuffle=False`` and
Expand Down Expand Up @@ -70,7 +71,7 @@ class PCDDataModule(L.LightningDataModule):
labels : sequence, optional
Column names of the ``.csv`` file containing the properties to be
predicted.
train_size : int, optional
train_size : int, default=None
Number of training samples. If :obj:`None`, all training samples are used.
train_transform_x : callable, optional
Transformation to apply to point cloud during training.
Expand Down Expand Up @@ -148,7 +149,7 @@ def __init__(

def setup(self, stage=None):
r"""
Setup train, validation and test datasets.
Set up train, validation and test datasets.
.. tip::
Datasets are accesible via ``self.{train,validation,test}_dataset``.
Expand Down
3 changes: 2 additions & 1 deletion src/aidsorb/litmodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@

class PCDLit(L.LightningModule):
r"""
``LightningModule`` for supervised learning on point clouds.
:class:`~lightning.pytorch.core.LightningModule` for supervised learning on
point clouds.
.. note::
* ``metric`` is logged on epoch-level.
Expand Down

0 comments on commit 034eb1c

Please sign in to comment.