Skip to content

Commit

Permalink
docs(PCDLit): improve note for batch's form
Browse files Browse the repository at this point in the history
  • Loading branch information
adosar committed Jan 28, 2025
1 parent b8b440d commit f2cf094
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/aidsorb/litmodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ class PCDLit(L.LightningModule):
point clouds.
.. note::
* ``metric`` is logged on epoch-level.
* ``*_step`` methods expect a ``batch`` of the form ``(pcds, labels)``.
``{train,validation,test}_step`` methods expect a batch of the form
``(x, y)``, where ``x`` is compatible with :meth:`PCDLit.forward` and
``y`` is compatible with output of :meth:`PCDLit.forward` as required by
``criterion`` and ``metric``. For :meth:`PCDLit.predict_step`, ``y`` is
ignored.
.. tip::
You can use ``'val_<MetricName>'`` as the quantity to monitor. For
Expand All @@ -53,14 +56,16 @@ class PCDLit(L.LightningModule):
criterion : callable
Loss function to be optimized during training.
metric : :class:`~torchmetrics.MetricCollection`
Metric(s) to be logged and optionally monitored.
Metric(s) to be logged and optionally monitored. Metric(s) are logged on
epoch-level.
config_optimizer : dict, default=None
Dictionary for configuring optimizer. If :obj:`None`, the
:class:`~torch.optim.Adam` optimizer with default hyperparameters is
used.
* ``'name'`` optimizer's class name :class:`str`
* ``'hparams'`` optimizer's hyperparameters :class:`dict`
config_scheduler : dict, optional
Dictionary for configuring learning rate scheduler.
Expand Down Expand Up @@ -130,7 +135,7 @@ def training_step(self, batch, batch_idx):
r"""
Compute and return training loss on a single batch from the train set.
Also, make predictions that will be used on epoch-level operations.
Also, make predictions that will be used for epoch-level operations.
.. note::
Training loss is computed with training mode enabled and thus, may
Expand Down

0 comments on commit f2cf094

Please sign in to comment.