Skip to content

Commit 60cd993

Browse files
Alex Sablayrollesfacebook-github-bot
authored andcommitted
Align make_private_with_epsilon with make_private (#509)
Summary: Fixes #467 Pull Request resolved: #509 Reviewed By: karthikprasad Differential Revision: D39538401 Pulled By: alexandresablayrolles fbshipit-source-id: b7804fd8a82440937831e504e8269a2a649efbda
1 parent edeb0c3 commit 60cd993

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

opacus/privacy_engine.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,13 @@ def make_private_with_epsilon(
443443
target_epsilon: float,
444444
target_delta: float,
445445
epochs: int,
446-
max_grad_norm: float,
446+
max_grad_norm: Union[float, List[float]],
447447
batch_first: bool = True,
448448
loss_reduction: str = "mean",
449+
poisson_sampling: bool = True,
450+
clipping: str = "flat",
449451
noise_generator=None,
450-
grad_sample_mode="hooks",
452+
grad_sample_mode: str = "hooks",
451453
**kwargs,
452454
):
453455
"""
@@ -522,6 +524,8 @@ def make_private_with_epsilon(
522524
loss_reduction=loss_reduction,
523525
noise_generator=noise_generator,
524526
grad_sample_mode=grad_sample_mode,
527+
poisson_sampling=poisson_sampling,
528+
clipping=clipping,
525529
)
526530

527531
def get_epsilon(self, delta):

0 commit comments

Comments
 (0)