Skip to content

Commit

Permalink
torch: Update documentation regarding the use of PyTorch optimizers
Browse files Browse the repository at this point in the history
  • Loading branch information
andreArtelt committed Aug 1, 2019
1 parent 589e83f commit 16a3bf0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ceml/torch/counterfactual.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,12 @@ def compute_counterfactual(self, x, y_target, features_whitelist=None, regulariz
`C` is ignored if no regularization is used (`regularization=None`).
The default is 1.0
optimizer : `str`, optional
optimizer : `str` or class that is derived from :class:`torch.optim.Optimizer`, optional
Name/Identifier of the optimizer that is used for computing the counterfactual.
See :func:`ceml.optim.optimizer.desc_to_optim` for details.
As an alternative, any optimizer from PyTorch can be used - `optimizer` must be class that is derived from :class:`torch.optim.Optimizer`.
The default is "nelder-mead".
optimizer_args : `dict`, optional
Dictionary containing additional parameters for the optimization algorithm.
Expand Down Expand Up @@ -241,12 +242,13 @@ def generate_counterfactual(model, x, y_target, device=torch.device('cpu'), feat
If no regularization is used (`regularization=None`), `C` is ignored.
The default is 1.0
optimizer : `str`, optional
Name/Identifier of the optimizer that is used for computing the counterfactual.
optimizer : `str` or class that is derived from :class:`torch.optim.Optimizer`, optional
Name/Identifier of the optimizer that is used for computing the counterfactual.
See :func:`ceml.optim.optimizer.desc_to_optim` for details.
See :func:`ceml.optimizer.optimizer.desc_to_optim` for details.
As an alternative, any optimizer from PyTorch can be used - `optimizer` must be class that is derived from :class:`torch.optim.Optimizer`.
The default is "nelder-mead".
The default is "nelder-mead".
optimizer_args : `dict`, optional
Dictionary containing additional parameters for the optimization algorithm.
Expand Down

0 comments on commit 16a3bf0

Please sign in to comment.