Skip to content

Commit

Permalink
Remove the Defaults to code doc pattern (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
ioangatop authored Jan 24, 2024
1 parent 5ad748a commit faf4f43
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/eva/data/datamodules/datamodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def __init__(
"""Initializes the datamodule.
Args:
datasets: The desired datasets. Defaults to `None`.
dataloaders: The desired dataloaders. Defaults to `None`.
datasets: The desired datasets.
dataloaders: The desired dataloaders.
"""
super().__init__()

Expand Down
6 changes: 3 additions & 3 deletions src/eva/metrics/core/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def from_metrics(
val: Metrics for the validation stage.
test: Metrics for the test stage.
separator: The separator between the group name of the metric
and the metric itself. Defaults to `"/"`.
and the metric itself.
"""
return cls(
train=_create_collection_from_metrics(train, prefix="train" + separator),
Expand All @@ -73,7 +73,7 @@ def from_schema(
Args:
schema: The dataclass metric schema.
separator: The separator between the group name of the metric
and the metric itself. Defaults to `"/"`.
and the metric itself.
"""
return cls.from_metrics(
train=schema.training_metrics,
Expand Down Expand Up @@ -105,7 +105,7 @@ def _create_collection_from_metrics(
Args:
metrics: The desired metrics.
prefix: A prefix to added to the collection. Defaults to `None`.
prefix: A prefix to added to the collection.
Returns:
The resulted metrics collection.
Expand Down
5 changes: 1 addition & 4 deletions src/eva/models/modules/head.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,10 @@ def __init__(
criterion: The loss function to use.
backbone: The feature extractor. If `None`, it will be expected
that the input batch returns the features directly.
Defaults to `None`.
optimizer: The optimizer to use.
Defaults to :class:`torch.optim.Adam`.
lr_scheduler: The learning rate scheduler to use.
Defaults to :class:`torch.optim.lr_scheduler.ConstantLR`.
metrics: The list of metrics to track. If `None`, it uses
the :meth:`self.default_metrics`. Defaults to `None`.
the :meth:`self.default_metrics`.
"""
super().__init__(metrics=metrics)

Expand Down
6 changes: 3 additions & 3 deletions src/eva/models/modules/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(
"""Initializes the basic module.
Args:
metrics: The metrics schema. Defaults to `None`.
metrics: The metrics schema.
"""
super().__init__()

Expand Down Expand Up @@ -131,7 +131,7 @@ def _update_metrics(
Args:
metrics: The desired metrics tracker to update.
batch_outputs: The outputs of the batch processing step.
dataloader_idx: The dataloader index. Defaults to `0`.
dataloader_idx: The dataloader index.
"""
inputs = self._parse_metrics_inputs(batch_outputs, dataloader_idx)
metrics.update(**inputs)
Expand Down Expand Up @@ -159,7 +159,7 @@ def _parse_metrics_inputs(
Args:
batch_outputs: The outputs of the batch processing step.
dataloader_idx: The dataloader index. Defaults to `0`.
dataloader_idx: The dataloader index.
Returns:
A mapping with the argument name and its value.
Expand Down

0 comments on commit faf4f43

Please sign in to comment.