Skip to content

Commit

Permalink
docsig and pydocstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
JenniferHem committed Sep 3, 2024
1 parent 33e1202 commit 4a117d5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
27 changes: 27 additions & 0 deletions molpipeline/estimators/chemprop/component_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,33 @@ def __init__(
threshold: float | None = None,
output_transform: UnscaleTransform | None = None,
):
"""Initialize the MulticlassClassificationFFN class.
Parameters
----------
n_classes : int
how many classes are expected in the output
n_tasks : int, optional (default=1)
Number of tasks.
input_dim : int, optional (default=DEFAULT_HIDDEN_DIM)
Input dimension.
hidden_dim : int, optional (default=300)
Hidden dimension.
n_layers : int, optional (default=1)
Number of layers.
dropout : float, optional (default=0)
Dropout rate.
activation : str, optional (default="relu")
Activation function.
criterion : LossFunction or None, optional (default=None)
Loss function. None defaults to BCELoss.
task_weights : Tensor or None, optional (default=None)
Task weights.
threshold : float or None, optional (default=None)
Threshold for binary classification.
output_transform : UnscaleTransform or None, optional (default=None)
Transformations to apply to the output. None defaults to UnscaleTransform.
"""
super().__init__(
n_tasks,
input_dim,
Expand Down
8 changes: 7 additions & 1 deletion molpipeline/estimators/chemprop/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,13 @@ def n_classes(self) -> int:

@n_classes.setter
def n_classes(self, n_classes: int) -> None:
"""Set the number of classes."""
"""Set the number of classes.
Parameters
----------
n_classes : int
number of classes
"""
self.model.predictor.n_classes = n_classes
self.model.reinitialize_network()

Expand Down

0 comments on commit 4a117d5

Please sign in to comment.