Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion opacus/tests/grad_samples/conv2d_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,5 @@ def test_asymetric_dilation_and_kernel_size(self) -> None:
y.backward(backprops)

self.assertLess(
torch.norm(m._module.weight.grad_sample[0] - m._module.weight.grad), 1e-7
torch.norm(m._module.weight.grad_sample[0] - m._module.weight.grad), 2e-7
)
2 changes: 1 addition & 1 deletion opacus/tests/privacy_engine_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def test_validator_weight_update_check(self) -> None:
Test that the privacy engine raises error if ModuleValidator.fix(model) is
called after the optimizer is created
"""
model = models.densenet121(pretrained=True)
model = models.densenet121(weights=None)
num_ftrs = model.classifier.in_features
model.classifier = nn.Sequential(nn.Linear(num_ftrs, 10), nn.Sigmoid())
optimizer = torch.optim.SGD(
Expand Down
1 change: 1 addition & 0 deletions opacus/validators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# on respective methods

from .batch_norm import fix, validate # noqa
from .gru import fix, validate # noqa
from .instance_norm import fix, validate # noqa
from .lstm import fix, validate # noqa
from .module_validator import ModuleValidator
Expand Down
Loading