Skip to content

Commit 9e1538e

Browse files
ProGamerGovfacebook-github-bot
authored andcommitted
Fix some docstrings (#996)
Summary: The "optional" part should come last. Pull Request resolved: #996 Reviewed By: 99warriors, Reubend Differential Revision: D38026646 Pulled By: NarineK fbshipit-source-id: 6648b3a2183dd4c8d29956e356f1ac5cd90d23cd
1 parent 65b4a84 commit 9e1538e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

captum/attr/_core/lime.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ def __init__(
734734
735735
forward_func (callable): The forward function of the model or any
736736
modification of it
737-
interpretable_model (optional, Model): Model object to train
737+
interpretable_model (Model, optional): Model object to train
738738
interpretable model.
739739
740740
This argument is optional and defaults to SkLearnLasso(alpha=0.01),
@@ -760,7 +760,7 @@ def __init__(
760760
Note that calling fit multiple times should retrain the
761761
interpretable model, each attribution call reuses
762762
the same given interpretable model object.
763-
similarity_func (optional, callable): Function which takes a single sample
763+
similarity_func (callable, optional): Function which takes a single sample
764764
along with its corresponding interpretable representation
765765
and returns the weight of the interpretable sample for
766766
training the interpretable model.
@@ -793,7 +793,7 @@ def __init__(
793793
794794
kwargs includes baselines, feature_mask, num_interp_features
795795
(integer, determined from feature mask).
796-
perturb_func (optional, callable): Function which returns a single
796+
perturb_func (callable, optional): Function which returns a single
797797
sampled input, which is a binary vector of length
798798
num_interp_features, or a generator of such tensors.
799799

captum/robust/_core/metrics/attack_comparator.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def add_attack(
118118
or any other perturbation or attack function such
119119
as a torchvision transform.
120120
121-
name (optional, str): Name or identifier for attack, used as key for
121+
name (str, optional): Name or identifier for attack, used as key for
122122
attack results. This defaults to attack.__class__.__name__
123123
if not provided and must be unique for all added attacks.
124124

0 commit comments

Comments
 (0)