diff --git a/api/_modules/opacus/layers/dp_multihead_attention.html b/api/_modules/opacus/layers/dp_multihead_attention.html index d96de274..16a7e6d3 100644 --- a/api/_modules/opacus/layers/dp_multihead_attention.html +++ b/api/_modules/opacus/layers/dp_multihead_attention.html @@ -124,6 +124,7 @@

Source code for opacus.layers.dp_multihead_attention

add_zero_attn=False, kdim=None, vdim=None, + batch_first=False, device=None, dtype=None, ): @@ -131,10 +132,13 @@

Source code for opacus.layers.dp_multihead_attention

self.embed_dim = embed_dim self.kdim = kdim if kdim is not None else embed_dim self.vdim = vdim if vdim is not None else embed_dim - self._qkv_same_embed_dim = self.kdim == embed_dim and self.vdim == embed_dim + + # when self._qkv_same_embed_dim = True, "in_proj_weight" rather than "q,k,v_weight" and fast path calculation will be used in "nn.transformer", which should be avoided. This is why we force self._qkv_same_embed_dim = False. + self._qkv_same_embed_dim = False self.num_heads = num_heads self.dropout = dropout + self.batch_first = batch_first self.head_dim = embed_dim // num_heads assert ( self.head_dim * num_heads == self.embed_dim @@ -155,6 +159,10 @@

Source code for opacus.layers.dp_multihead_attention

self.dropout = nn.Dropout(dropout) + # to avoid null pointers in Transformer.forward + self.in_proj_weight = None + self.in_proj_bias = None +
[docs] def load_state_dict(self, state_dict): @@ -218,7 +226,33 @@

Source code for opacus.layers.dp_multihead_attention

key_padding_mask=None, need_weights=True, attn_mask=None, + is_causal=False, ): + is_batched = query.dim() == 3 + + assert is_batched == True, "The query must have a dimension of 3." + + r""" + As per https://github.com/pytorch/opacus/issues/596, we have to include ``is_causal`` as a dummy parameter of the function, + since it is used in the ``forward`` function of parent class ``nn.TransformerEncoderLayer``. + """ + assert ( + is_causal == False + ), "We currently do not support causal mask. Will fix it in the future." + + r""" + Using the same logic with ``nn.MultiheadAttention`` (https://pytorch.org/docs/stable/generated/torch.nn.MultiheadAttention.html). + """ + if self.batch_first: + if key is value: + if query is key: + query = key = value = query.transpose(1, 0) + else: + query, key = [x.transpose(1, 0) for x in (query, key)] + value = key + else: + query, key, value = [x.transpose(1, 0) for x in (query, key, value)] + tgt_len, bsz, embed_dim = query.size() if embed_dim != self.embed_dim: raise ValueError( @@ -363,6 +397,9 @@

Source code for opacus.layers.dp_multihead_attention

) attn_output = self.out_proj(attn_output) + if self.batch_first: + attn_output = attn_output.transpose(1, 0) + if need_weights: # average attention weights over heads attn_output_weights = attn_output_weights.view( @@ -404,7 +441,7 @@

Source code for opacus.layers.dp_multihead_attention

keep_vars=keep_vars, ) - if self._qkv_same_embed_dim: + if (self.kdim == self.embed_dim) and (self.vdim == self.embed_dim): destination_alter[prefix + "in_proj_weight"] = torch.cat( ( destination[prefix + "qlinear.weight"], diff --git a/api/_modules/opacus/layers/dp_multihead_attention/index.html b/api/_modules/opacus/layers/dp_multihead_attention/index.html index d96de274..16a7e6d3 100644 --- a/api/_modules/opacus/layers/dp_multihead_attention/index.html +++ b/api/_modules/opacus/layers/dp_multihead_attention/index.html @@ -124,6 +124,7 @@

Source code for opacus.layers.dp_multihead_attention

add_zero_attn=False, kdim=None, vdim=None, + batch_first=False, device=None, dtype=None, ): @@ -131,10 +132,13 @@

Source code for opacus.layers.dp_multihead_attention

self.embed_dim = embed_dim self.kdim = kdim if kdim is not None else embed_dim self.vdim = vdim if vdim is not None else embed_dim - self._qkv_same_embed_dim = self.kdim == embed_dim and self.vdim == embed_dim + + # when self._qkv_same_embed_dim = True, "in_proj_weight" rather than "q,k,v_weight" and fast path calculation will be used in "nn.transformer", which should be avoided. This is why we force self._qkv_same_embed_dim = False. + self._qkv_same_embed_dim = False self.num_heads = num_heads self.dropout = dropout + self.batch_first = batch_first self.head_dim = embed_dim // num_heads assert ( self.head_dim * num_heads == self.embed_dim @@ -155,6 +159,10 @@

Source code for opacus.layers.dp_multihead_attention

self.dropout = nn.Dropout(dropout) + # to avoid null pointers in Transformer.forward + self.in_proj_weight = None + self.in_proj_bias = None +
[docs] def load_state_dict(self, state_dict): @@ -218,7 +226,33 @@

Source code for opacus.layers.dp_multihead_attention

key_padding_mask=None, need_weights=True, attn_mask=None, + is_causal=False, ): + is_batched = query.dim() == 3 + + assert is_batched == True, "The query must have a dimension of 3." + + r""" + As per https://github.com/pytorch/opacus/issues/596, we have to include ``is_causal`` as a dummy parameter of the function, + since it is used in the ``forward`` function of parent class ``nn.TransformerEncoderLayer``. + """ + assert ( + is_causal == False + ), "We currently do not support causal mask. Will fix it in the future." + + r""" + Using the same logic with ``nn.MultiheadAttention`` (https://pytorch.org/docs/stable/generated/torch.nn.MultiheadAttention.html). + """ + if self.batch_first: + if key is value: + if query is key: + query = key = value = query.transpose(1, 0) + else: + query, key = [x.transpose(1, 0) for x in (query, key)] + value = key + else: + query, key, value = [x.transpose(1, 0) for x in (query, key, value)] + tgt_len, bsz, embed_dim = query.size() if embed_dim != self.embed_dim: raise ValueError( @@ -363,6 +397,9 @@

Source code for opacus.layers.dp_multihead_attention

) attn_output = self.out_proj(attn_output) + if self.batch_first: + attn_output = attn_output.transpose(1, 0) + if need_weights: # average attention weights over heads attn_output_weights = attn_output_weights.view( @@ -404,7 +441,7 @@

Source code for opacus.layers.dp_multihead_attention

keep_vars=keep_vars, ) - if self._qkv_same_embed_dim: + if (self.kdim == self.embed_dim) and (self.vdim == self.embed_dim): destination_alter[prefix + "in_proj_weight"] = torch.cat( ( destination[prefix + "qlinear.weight"], diff --git a/api/dp_multihead_attention.html b/api/dp_multihead_attention.html index fa61ddaa..16aa3ead 100644 --- a/api/dp_multihead_attention.html +++ b/api/dp_multihead_attention.html @@ -75,7 +75,7 @@
-class opacus.layers.dp_multihead_attention.DPMultiheadAttention(embed_dim, num_heads, dropout=0.0, bias=True, add_bias_kv=False, add_zero_attn=False, kdim=None, vdim=None, device=None, dtype=None)[source]
+class opacus.layers.dp_multihead_attention.DPMultiheadAttention(embed_dim, num_heads, dropout=0.0, bias=True, add_bias_kv=False, add_zero_attn=False, kdim=None, vdim=None, batch_first=False, device=None, dtype=None)[source]

This is DP-friendly implementation of nn.MultiheadAttention. For full reference see original module refer to torch.nn.MultiheadAttention.

@@ -85,7 +85,7 @@

Initializes internal Module state, shared by both nn.Module and ScriptModule.

-forward(query, key, value, key_padding_mask=None, need_weights=True, attn_mask=None)[source]
+forward(query, key, value, key_padding_mask=None, need_weights=True, attn_mask=None, is_causal=False)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

diff --git a/api/dp_multihead_attention/index.html b/api/dp_multihead_attention/index.html index fa61ddaa..16aa3ead 100644 --- a/api/dp_multihead_attention/index.html +++ b/api/dp_multihead_attention/index.html @@ -75,7 +75,7 @@
-class opacus.layers.dp_multihead_attention.DPMultiheadAttention(embed_dim, num_heads, dropout=0.0, bias=True, add_bias_kv=False, add_zero_attn=False, kdim=None, vdim=None, device=None, dtype=None)[source]
+class opacus.layers.dp_multihead_attention.DPMultiheadAttention(embed_dim, num_heads, dropout=0.0, bias=True, add_bias_kv=False, add_zero_attn=False, kdim=None, vdim=None, batch_first=False, device=None, dtype=None)[source]

This is DP-friendly implementation of nn.MultiheadAttention. For full reference see original module refer to torch.nn.MultiheadAttention.

@@ -85,7 +85,7 @@

Initializes internal Module state, shared by both nn.Module and ScriptModule.

-forward(query, key, value, key_padding_mask=None, need_weights=True, attn_mask=None)[source]
+forward(query, key, value, key_padding_mask=None, need_weights=True, attn_mask=None, is_causal=False)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

diff --git a/js/searchindex.js b/js/searchindex.js index 0675bfec..8bf312c0 100644 --- a/js/searchindex.js +++ b/js/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["accounting/accounting", "accounting/gdp", "accounting/iaccountant", "accounting/rdp", "accounting/utils", "batch_memory_manager", "compute_dp_sgd_privacy", "data_loader", "distributed", "dp_multihead_attention", "dp_rnn", "grad_sample_module", "index", "layers", "noise_scheduler", "optim/dp_ddp_optimizer", "optim/dp_ddp_per_layer_optimizer", "optim/dp_optimizer", "optim/dp_per_layer_optimizer", "optim/optimizers", "privacy_engine", "scripts", "utils/module_utils", "utils/packed_sequences", "utils/tensor_utils", "utils/uniform_sampler", "utils/utils", "validator"], "filenames": ["accounting/accounting.rst", "accounting/gdp.rst", "accounting/iaccountant.rst", "accounting/rdp.rst", "accounting/utils.rst", "batch_memory_manager.rst", "compute_dp_sgd_privacy.rst", "data_loader.rst", "distributed.rst", "dp_multihead_attention.rst", "dp_rnn.rst", "grad_sample_module.rst", "index.rst", "layers.rst", "noise_scheduler.rst", "optim/dp_ddp_optimizer.rst", "optim/dp_ddp_per_layer_optimizer.rst", "optim/dp_optimizer.rst", "optim/dp_per_layer_optimizer.rst", "optim/optimizers.rst", "privacy_engine.rst", "scripts.rst", "utils/module_utils.rst", "utils/packed_sequences.rst", "utils/tensor_utils.rst", "utils/uniform_sampler.rst", "utils/utils.rst", "validator.rst"], "titles": ["Privacy Accounting", "GaussianAccountant", "IAccountant", "RDPAccountant", "Utils", "Batch Memory Manager", "Compute DP-SGD Privacy", "DP Data Loader", "Distributed", "DPMultiheadAttention", "DPRNN", "GradSampleModule", "Opacus API Reference", "DP Layers", "Noise Scheduler", "DistributedDPOptimizer", "DistributedPerLayerOptimizer", "DPOptimizer", "DPPerLayerOptimizer", "Optimizers", "Privacy Engine", "Scripts", "Module Utils", "Packed Sequences", "Tensor Utils", "Uniform Sampler", "Utils", "ModuleValidator"], "terms": {"iaccount": [0, 12], "get_epsilon": [0, 1, 2, 3, 20], "get_optimizer_hook_fn": [0, 2], "load_state_dict": [0, 2, 9, 13, 17, 19], "mechan": [0, 1, 2, 3, 4, 6, 7, 20, 25], "state_dict": [0, 2, 9, 13, 17, 19, 20], "step": [0, 1, 2, 3, 4, 5, 6, 11, 15, 16, 17, 19, 25], "rdpaccount": [0, 12, 20], "gaussianaccount": [0, 12, 20], "util": [0, 5, 7, 12, 23, 25, 27], "get_noise_multipli": [0, 4], "class": [1, 2, 3, 5, 7, 8, 9, 10, 11, 15, 16, 17, 18, 20, 25, 27], "opacu": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 20, 22, 23, 24, 25, 27], "account": [1, 2, 3, 4, 6, 12, 16, 17, 20], "gdp": [1, 20], "sourc": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 20, 22, 23, 24, 25, 27], "delta": [1, 2, 3, 4, 6, 20], "poisson": [1, 7, 15, 16, 17, 18, 20, 25], "true": [1, 6, 7, 9, 10, 11, 15, 16, 17, 18, 20, 24, 25], "return": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 20, 22, 23, 24, 25, 27], "privaci": [1, 2, 3, 4, 12, 16, 17, 21], "budget": [1, 2, 3, 4, 6, 20], "epsilon": [1, 2, 3, 4, 6, 20], "expend": [1, 2, 3, 20], "so": [1, 2, 3, 7, 9, 11, 17, 20, 22], "far": [1, 2, 3, 20], "paramet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 20, 22, 23, 24, 25, 27], "float": [1, 2, 3, 4, 6, 7, 15, 16, 17, 18, 20, 25], "target": [1, 2, 3, 6, 20, 22], "bool": [1, 6, 7, 9, 10, 11, 15, 16, 17, 18, 20, 22, 24, 25, 27], "i": [1, 2, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 20, 22, 24, 25, 27], "input": [1, 5, 6, 7, 9, 10, 11, 20, 24], "batch": [1, 6, 7, 9, 10, 11, 12, 15, 16, 17, 18, 20, 23, 24, 25], "wa": [1, 5, 11, 17], "sampl": [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 15, 16, 17, 18, 20, 24, 25], "via": [1, 7], "fals": [1, 7, 9, 10, 11, 15, 16, 17, 18, 20, 22, 27], "otherwis": [1, 7, 9, 11, 15, 17, 20, 22, 25], "type": [1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 15, 16, 17, 20, 22, 23, 24, 25, 27], "classmethod": [1, 2, 3, 7, 11, 20, 27], "name": [1, 2, 3, 9, 24], "str": [1, 2, 3, 4, 9, 11, 15, 16, 17, 18, 20, 22, 24], "noise_multipli": [1, 2, 3, 6, 15, 16, 17, 18, 20], "sample_r": [1, 2, 3, 4, 6, 7, 25], "signal": [1, 2, 3, 17], "one": [1, 2, 3, 5, 7, 8, 9, 10, 11, 17, 20, 25], "optim": [1, 2, 3, 5, 6, 11, 12, 15, 16, 17, 18, 20], "current": [1, 2, 3, 5, 9, 11, 16, 17, 20], "nois": [1, 2, 3, 4, 6, 12, 15, 16, 17, 18, 20], "multipli": [1, 2, 3, 6, 15, 16, 17, 18], "rate": [1, 2, 3, 4, 6, 16, 17], "abstract": [2, 10], "arg": [2, 8, 10, 11], "kwarg": [2, 4, 7, 8, 11, 20, 27], "subclass": [2, 7, 8, 9, 10, 11, 17], "specif": [2, 10, 16, 17], "callback": 2, "function": [2, 6, 7, 8, 9, 10, 11, 15, 17, 20, 22, 23, 24, 27], "which": [2, 6, 7, 11, 17, 20, 25, 27], "can": [2, 5, 6, 7, 10, 11, 15, 16, 17, 18, 20, 22], "us": [2, 3, 4, 5, 7, 9, 10, 11, 15, 16, 17, 18, 20, 23, 25], "attach": [2, 17], "dpoptim": [2, 5, 12, 15, 16, 18, 19, 20], "param": [2, 11, 17, 19, 20, 24], "expect": [2, 7, 11, 17, 20, 25], "callabl": [2, 7, 15, 16, 17], "none": [2, 3, 4, 7, 8, 9, 10, 11, 15, 16, 17, 18, 20, 24, 25], "valid": [2, 11, 20, 27], "suppli": [2, 27], "popul": 2, "": [2, 4, 6, 7, 9, 10, 17, 20, 22, 23, 24], "state": [2, 8, 9, 10, 17, 20, 22], "dict": [2, 9, 17, 20, 22], "typevar": [2, 7], "t_state_dict": 2, "bound": [2, 20], "map": [2, 17], "ani": [2, 7, 11, 17, 20, 22], "load": [2, 9, 10, 17], "rais": [2, 6, 11, 20, 22, 27], "valueerror": [2, 6, 11], "invalid": [2, 11, 20], "cannot": 2, "destin": [2, 9], "dictionari": [2, 9, 17], "contain": [2, 9, 10, 17, 23, 24], "rtype": [2, 10], "option": [2, 3, 4, 7, 9, 15, 16, 17, 18, 20], "mappabl": 2, "object": [2, 5, 7, 9, 15, 16, 17, 18, 20, 25], "If": [2, 5, 6, 9, 10, 11, 17, 20, 22], "thi": [2, 5, 6, 7, 8, 9, 10, 11, 15, 17, 20, 22, 24, 25], "an": [2, 6, 7, 9, 10, 11, 17, 20, 22, 24, 27], "ordereddict": [2, 9], "creat": [2, 7, 9, 11, 23, 24], "default": [2, 7, 9, 10, 25], "rdp": [3, 4, 6, 20], "alpha": [3, 6], "list": [3, 5, 6, 7, 10, 11, 16, 17, 18, 20, 23, 24, 27], "union": [3, 7, 10, 20, 24], "int": [3, 4, 5, 6, 9, 10, 15, 16, 17, 18, 20, 24, 25], "order": [3, 6, 9, 17, 25], "search": [3, 4, 12], "convers": 3, "between": [3, 7, 16, 17, 24, 25], "epd": 3, "dp": [3, 9, 10, 12, 20, 21, 27], "target_epsilon": [4, 20], "target_delta": [4, 20], "epoch": [4, 6, 20, 25], "epsilon_toler": 4, "0": [4, 6, 7, 9, 10, 17, 20, 24, 25], "01": [4, 6, 17], "comput": [4, 8, 9, 10, 11, 12, 20, 21, 23], "level": [4, 8, 17], "sigma": [4, 20], "reach": 4, "total": [4, 25], "end": [4, 5, 9, 11, 20], "given": [4, 7, 8, 11, 17, 20, 22, 24, 25], "usual": [4, 20], "batch_siz": [4, 5, 7, 10, 11, 15, 16, 17, 18, 20, 23], "n_data": 4, "number": [4, 6, 7, 16, 17, 20, 24, 25], "run": [4, 8, 9, 10, 11, 20, 27], "estim": [4, 6], "precis": 4, "binari": 4, "The": [4, 6, 9, 10, 11, 16, 17, 20, 22, 24, 25, 27], "ensur": [4, 20, 25], "batch_memory_manag": 5, "batchmemorymanag": [5, 12, 17], "data_load": [5, 7, 20], "max_physical_batch_s": 5, "context": 5, "consumpt": 5, "dure": [5, 11, 20, 24], "train": [5, 6, 10, 20, 27], "allow": [5, 9], "set": [5, 7, 9, 11, 17, 20, 24, 25], "hard": 5, "limit": [5, 10, 17], "physic": 5, "size": [5, 6, 7, 9, 10, 15, 16, 17, 18, 23, 24, 25], "just": [5, 17, 20, 22], "line": [5, 6], "code": [5, 6], "chang": [5, 20], "both": [5, 8, 9, 10, 24], "simul": [5, 17], "larg": [5, 17], "logic": [5, 27], "safeguard": 5, "against": 5, "occasion": 5, "produc": [5, 7], "uniformwithreplacementsampl": [5, 7, 25, 26], "note": [5, 10, 11, 17, 20], "doesn": [5, 10, 11, 20, 22], "t": [5, 7, 10, 11, 15, 16, 17, 18, 20, 22], "modifi": [5, 15, 17, 20], "dataload": [5, 7, 20], "you": [5, 6, 7, 11, 20, 27], "d": [5, 10, 24], "need": [5, 7, 8, 9, 10, 11], "new": [5, 7, 20], "batchsplittingsampl": [5, 12], "split": [5, 25], "smaller": 5, "sub": 5, "certain": [5, 7, 20], "maximum": [5, 20], "On": [5, 17], "everi": [5, 8, 9, 10, 11, 17, 20, 27], "check": [5, 11, 17, 20, 22, 27], "last": [5, 10, 17, 24], "compris": 5, "behaviour": [5, 7, 11, 17], "accordingli": 5, "onli": [5, 10, 11, 17, 24], "clip": [5, 15, 16, 17, 18, 20], "per": [5, 9, 10, 11, 16, 17, 18, 20], "gradient": [5, 8, 9, 11, 15, 16, 17, 18, 20, 22], "sum": [5, 11, 15, 16, 17, 18, 20, 24, 25], "them": [5, 7, 8, 9, 10, 11], "p": [5, 10, 11, 15, 16, 17, 18], "summed_grad": [5, 16, 17, 18], "zero_grad": [5, 17, 19], "clear": [5, 11, 17], "grad_sampl": [5, 10, 11, 17, 19], "leav": [5, 20], "grad": [5, 10, 11, 15, 16, 17, 18, 22], "behav": [5, 17, 20], "normal": [5, 17, 20], "exampl": [5, 6, 7, 9, 10, 17, 20, 24], "assum": [5, 17, 24], "ve": 5, "initi": [5, 8, 9, 10], "your": [5, 20, 27], "pass": [5, 7, 8, 9, 10, 11, 16, 17, 20, 27], "privacyengin": [5, 12, 20], "For": [5, 8, 9, 11, 17, 20, 24], "we": [5, 7, 11, 17, 20], "4": [5, 7, 9, 10, 17, 24], "model": [5, 6, 8, 10, 11, 15, 16, 17, 20, 22], "_init_private_train": 5, "criterion": 5, "nn": [5, 8, 9, 10, 11, 17, 22, 23, 24, 27], "crossentropyloss": 5, "2": [5, 6, 7, 10, 11, 17, 24], "new_data_load": 5, "data": [5, 8, 10, 11, 12, 15, 16, 20], "label": 5, "assert": 5, "len": 5, "more": [5, 11, 20, 22, 24], "than": [5, 6, 20], "output": [5, 7, 9, 10, 24, 25], "loss": [5, 6, 11, 15, 16, 17, 18, 20], "backward": [5, 10, 11, 16, 17], "won": [5, 17], "actual": [5, 15, 16, 17, 18], "make": [5, 11, 27], "unless": [5, 11, 15, 17], "over": [5, 6, 7, 8, 10, 11, 17, 20, 22, 24], "sampler": [5, 7, 11, 12, 26], "max_batch_s": [5, 10], "accord": [5, 25], "underli": [5, 16, 17], "instanc": [5, 7, 8, 9, 10, 11], "index": [5, 12], "sequenc": [5, 7, 9, 10, 12, 26], "chunk": [5, 25], "while": [5, 8, 9, 10, 11, 22], "coordin": 5, "when": [5, 6, 9, 10, 11, 15, 16, 17, 18, 20, 24, 25], "ha": [5, 9, 10, 11, 20], "wrap": [5, 7, 11, 15, 16, 17, 18, 20], "max": [5, 15, 16, 17, 18], "emit": 5, "indic": [5, 11, 15, 16, 17, 18, 20, 22, 25, 27], "notifi": 5, "wrap_data_load": [5, 12], "replac": [5, 10, 20], "batch_sampl": [5, 7], "loader": [5, 12, 20], "wrapper": [5, 17, 20, 22], "want": [5, 11, 20, 22, 27], "command": 6, "script": [6, 12], "appli": [6, 10, 17, 22, 25], "iter": [6, 10, 20, 22, 24, 25], "gaussian": [6, 17, 20, 25], "mainli": 6, "base": [6, 7, 8, 9, 10, 11, 20], "googl": 6, "tf": 6, "http": [6, 9, 10, 11, 22], "github": [6, 10, 11], "com": [6, 10, 11], "tensorflow": 6, "blob": 6, "master": 6, "tensorflow_privaci": 6, "analysi": 6, "compute_dp_sgd_privaci": [6, 21], "py": 6, "To": 6, "call": [6, 8, 9, 10, 11, 16, 17], "from": [6, 7, 9, 10, 11, 15, 16, 17, 18, 22, 24, 25], "enter": 6, "python": 6, "m": [6, 9, 11], "3": [6, 10, 17, 24], "1e": 6, "5": [6, 7, 10, 17, 24], "1": [6, 9, 10, 11, 16, 17, 20, 22, 24, 25], "10": 6, "20": [6, 9], "100": 6, "300": 6, "satisfi": 6, "differenti": [6, 20], "39": 6, "05": [6, 20], "verbos": 6, "perform": [6, 8, 9, 10, 11, 15, 16, 17, 18, 20], "find": 6, "probabl": [6, 7, 20, 25], "each": [6, 7, 10, 11, 17, 24, 25], "dataset": [6, 7, 20, 25], "select": [6, 7, 25], "next": [6, 7, 17, 25], "ratio": [6, 20], "standard": [6, 10, 20], "deviat": [6, 20], "l2": [6, 20], "sensit": [6, 20], "ad": [6, 9, 11, 17, 20, 24], "A": [6, 10, 15, 16, 17, 24], "enabl": [6, 7, 11, 20, 25], "print": [6, 10], "result": [6, 11, 15, 16, 17, 24], "tupl": [6, 7, 10, 11, 20, 22, 24], "pair": [6, 10], "greater": 6, "dpdataload": [7, 12], "collate_fn": 7, "drop_last": 7, "gener": [7, 15, 16, 17, 18, 20, 22, 24, 25], "distribut": [7, 12, 15, 16, 20, 25], "alwai": [7, 10, 11, 17, 22, 27], "doe": [7, 11, 17, 20], "support": [7, 9, 10, 11, 20, 22, 24], "empti": [7, 11, 17], "typic": [7, 16, 17], "instanti": 7, "from_data_load": 7, "method": [7, 11, 20, 24], "anoth": 7, "would": [7, 16, 17], "preserv": 7, "origin": [7, 9, 10, 20], "except": [7, 10, 11, 16, 17, 24, 27], "two": [7, 16, 17, 22], "aspect": 7, "first": [7, 11, 20, 24, 27], "switch": 7, "thu": 7, "e": [7, 9, 10, 11], "element": [7, 9, 10, 25], "defin": [7, 8, 9, 10, 11], "nb": 7, "lead": 7, "variabl": 7, "nb2": 7, "By": 7, "calcul": [7, 9, 11, 16, 17, 20, 24], "averag": [7, 8, 9, 11, 15, 16, 17, 18], "stai": 7, "same": [7, 9, 10, 11, 17, 20, 23, 24, 25, 27], "second": [7, 11], "collat": [7, 12], "most": [7, 15, 16, 17], "pytorch": [7, 9, 10, 11, 20, 22], "modul": [7, 8, 9, 10, 11, 12, 17, 20, 26, 27], "happili": 7, "process": [7, 11, 15, 16, 17, 24], "tensor": [7, 9, 10, 11, 12, 15, 17, 20, 23, 26], "shape": [7, 9, 10, 11, 17, 24], "n": [7, 9], "mani": [7, 10], "fail": 7, "As": [7, 11], "becom": 7, "possibl": [7, 11, 16, 17], "handl": 7, "see": [7, 9, 10, 11, 15, 16, 17, 18, 20, 22, 24], "torch": [7, 8, 9, 10, 11, 15, 16, 17, 18, 20, 22, 23, 24, 25], "includ": [7, 9, 22], "num_work": 7, "pin_memori": 7, "timeout": 7, "worker_init_fn": 7, "multiprocessing_context": 7, "random": [7, 15, 16, 17, 18, 20, 25], "prefetch_factor": 7, "persistent_work": 7, "ll": 7, "ddp": 7, "environ": 7, "distributeduniformwithreplacementsampl": [7, 25, 26], "implement": [7, 8, 9, 10, 11, 16, 18, 20, 22, 24], "argument": [7, 9, 10, 17, 20, 27], "must": [7, 10, 11], "iterabledataset": 7, "all": [7, 8, 9, 10, 11, 17, 20, 22, 24, 25, 27], "attribut": [7, 10, 11, 17], "inherit": 7, "x": [7, 9, 10, 24], "y": [7, 10], "randn": [7, 9], "64": 7, "randint": 7, "tensordataset": 7, "dp_data_load": 7, "sample_empty_shap": 7, "dtype": [7, 9], "length": [7, 9, 10, 23, 24, 25], "zero": [7, 10, 17, 24], "sinc": [7, 8, 9, 10, 11], "case": [7, 11, 27], "correct": 7, "albeit": 7, "dimens": [7, 9, 10, 11, 20, 24], "being": [7, 9, 10, 20, 24], "tensort": 7, "collam": 7, "dtype_saf": [7, 12], "safe": 7, "getter": 7, "exist": [7, 11, 22, 27], "shape_saf": [7, 12], "switch_gener": [7, 12], "exact": 7, "provid": [7, 9, 20], "enhanc": 7, "user": [7, 9], "cryptograph": [7, 20], "secur": [7, 20], "wrap_collate_with_empti": [7, 12], "equival": [7, 20, 24], "non": [7, 10, 11, 17, 20], "differentiallyprivatedistributeddataparallel": [8, 12], "parallel": [8, 16], "packag": 8, "intern": [8, 9, 10], "share": [8, 9, 10], "scriptmodul": [8, 9, 10], "forward": [8, 9, 10, 11, 13, 16, 17], "should": [8, 9, 10, 11, 15, 17, 20, 22], "overridden": [8, 9, 10, 11], "although": [8, 9, 10, 11], "recip": [8, 9, 10, 11], "within": [8, 9, 10, 11], "afterward": [8, 9, 10, 11], "instead": [8, 9, 10, 11, 17, 20], "former": [8, 9, 10, 11], "take": [8, 9, 10, 11, 15, 16, 17, 18, 20, 27], "care": [8, 9, 10, 11], "regist": [8, 9, 10, 11, 20, 27], "hook": [8, 9, 10, 11, 17, 20], "latter": [8, 9, 10, 11], "silent": [8, 9, 10, 11], "ignor": [8, 9, 10, 11, 15, 16, 17, 18, 24], "average_gradi": [8, 12], "worker": [8, 25], "layer": [9, 10, 11, 12, 16, 18, 20, 24], "dp_multihead_attent": 9, "sequencebia": [9, 13], "embed_dim": 9, "batch_first": [9, 10, 11, 20], "add": [9, 11, 15, 16, 17, 20], "bia": [9, 10, 13], "l": [9, 10, 24], "where": [9, 10, 11, 17, 24], "embed": 9, "have": [9, 11, 17, 22], "learnabl": 9, "16": 9, "21": 9, "num_head": 9, "dropout": [9, 10], "add_bias_kv": 9, "add_zero_attn": 9, "kdim": 9, "vdim": 9, "devic": 9, "friendli": [9, 10], "multiheadattent": 9, "full": [9, 10, 11, 20], "refer": [9, 10], "leverag": 9, "build": 9, "block": [9, 24], "engin": [9, 12], "contrast": 9, "queri": 9, "kei": 9, "valu": [9, 11, 15, 16, 17, 18, 20], "key_padding_mask": 9, "need_weight": 9, "attn_mask": 9, "previous": 9, "save": [9, 11, 17, 20], "pleas": 9, "org": [9, 22], "tutori": 9, "what_is_state_dict": 9, "html": [9, 22], "prefix": 9, "keep_var": 9, "whole": 9, "persist": 9, "buffer": 9, "g": [9, 10, 11], "ar": [9, 11, 16, 17, 20, 22, 27], "correspond": [9, 10, 11, 17, 20], "shallow": 9, "copi": [9, 20, 22], "It": [9, 17, 23, 24, 27], "also": [9, 17, 20, 22, 27], "accept": 9, "posit": 9, "howev": [9, 11], "deprec": 9, "keyword": [9, 27], "enforc": 9, "futur": 9, "releas": 9, "avoid": 9, "design": 9, "updat": [9, 15, 17, 20], "compos": 9, "detach": 9, "autograd": [9, 11], "xdoctest": 9, "skip": [9, 17], "undefin": 9, "var": 9, "weight": [9, 17], "dp_rnn": 10, "dpgru": [10, 13], "input_s": 10, "hidden_s": 10, "num_lay": 10, "bidirect": 10, "proj_siz": 10, "multi": 10, "gate": 10, "recurr": [10, 11], "unit": 10, "gru": 10, "rnn": [10, 23], "drop": 10, "document": [10, 20], "descript": 10, "after": [10, 17, 20], "export": 10, "infer": [10, 15, 16, 17, 18], "dpgrucel": [10, 13], "cell": 10, "grucel": 10, "hx": 10, "batch_size_t": 10, "dplstm": [10, 13], "long": 10, "short": 10, "term": 10, "memori": [10, 12, 17], "lstm": 10, "dplstmcell": [10, 13], "lstmcell": 10, "nonlinear": 10, "tanh": 10, "elman": 10, "math": 10, "anh": 10, "ext": 10, "relu": 10, "linear": 10, "dprnnbase": [10, 13], "mode": [10, 20], "cell_param": 10, "like": [10, 17, 20, 24], "rnnbase": 10, "issu": [10, 11], "4930": 10, "issuecom": 10, "361851298": 10, "bi": 10, "direct": 10, "sequenti": 10, "dprnncellbas": [10, 13], "cudnn": 10, "state_init": 10, "singl": [10, 15, 17, 24], "here": [10, 22], "equal": [10, 25], "hidden": 10, "packedsequ": [10, 23], "h_0": 10, "c_0": 10, "b": [10, 24], "h": [10, 24], "addit": [10, 17, 20], "h_n": 10, "c_n": 10, "featur": 10, "h_t": 10, "final": 10, "num_direct": 10, "els": 10, "forward_lay": [10, 13], "seq_length": 10, "is_pack": 10, "reverse_lay": 10, "c_t": 10, "h_last": 10, "c_last": 10, "timestep": 10, "store": [10, 11, 15, 16, 17, 18, 23], "network": 10, "dprnncell": [10, 13], "whether": [10, 11, 25, 27], "revers": 10, "iterate_lay": [10, 13], "through": 10, "self": [10, 17], "dir": 10, "hi": 10, "rnncell": 10, "num_chunk": 10, "rnnlinear": [10, 13], "in_featur": 10, "out_featur": 10, "transform": 10, "incom": 10, "xa": 10, "get": 10, "accumul": [10, 11, 16, 17], "concaten": 10, "max_batch_len": [10, 11], "determin": [10, 20], "apply_permut": [10, 13], "dim": [10, 11, 24], "permut": 10, "along": 10, "do": [10, 11, 17], "noth": [10, 11, 17], "grad_sample_modul": 11, "loss_reduct": [11, 15, 16, 17, 18, 20], "mean": [11, 15, 16, 17, 18, 20], "strict": [11, 27], "force_functorch": 11, "abstractgradsamplemodul": [11, 20], "custom": [11, 27], "written": 11, "readm": 11, "md": 11, "detail": [11, 15, 16, 17, 18, 20, 22, 24], "flag": [11, 17, 20, 22, 24, 25, 27], "repres": [11, 20, 23], "k": [11, 20], "reduct": [11, 15, 16, 17, 18, 20], "aggreg": [11, 15, 16, 17, 18, 20, 24], "oper": [11, 15, 16, 17, 18, 20], "submodul": [11, 20, 22], "know": 11, "how": [11, 20], "best": 11, "effort": 11, "basi": 11, "thei": [11, 17, 22], "avail": 11, "recommend": 11, "becaus": [11, 17], "some": [11, 17, 20], "unsupport": 11, "batchnorm": 11, "affect": [11, 17], "other": [11, 16, 17, 20], "concept": 11, "entir": [11, 20], "functorch": 11, "without": [11, 17], "notimplementederror": 11, "its": [11, 25], "add_hook": 11, "activ": 11, "backprop": 11, "remove_hook": 11, "disabl": 11, "allow_grad_accumul": 11, "unset": 11, "detect": 11, "multipl": 11, "out": [11, 17], "throw": [11, 22], "capture_backprops_hook": 11, "_forward_input": 11, "forward_output": 11, "associ": [11, 17], "field": [11, 15, 17], "straightforward": 11, "exactli": 11, "complic": 11, "time": [11, 27], "still": 11, "reason": 11, "_current_grad_sampl": 11, "could": 11, "either": 11, "disable_hook": 11, "global": 11, "instal": [11, 20], "librari": 11, "why": 11, "25723": 11, "bug": 11, "remov": [11, 22, 24], "graph": 11, "alreadi": [11, 20], "construct": [11, 20], "least": 11, "turn": 11, "off": 11, "enable_hook": 11, "opposit": 11, "explicitli": 11, "don": 11, "re": 11, "forbid_grad_accumul": 11, "is_support": 11, "individu": [11, 20], "found": [11, 20], "rearrange_grad_sampl": 11, "rearrang": 11, "captur": 11, "depend": [11, 27], "fulli": 11, "raise_if_error": 11, "neg": 11, "Will": 11, "success": 11, "error": [11, 20, 22, 27], "create_or_accumulate_grad_sampl": [11, 12], "extra": [11, 24], "belong": [11, 17], "gradsamplemodul": [12, 17, 20], "dpperlayeroptim": [12, 19], "distributeddpoptim": [12, 19], "distributedperlayeroptim": [12, 19], "modulevalid": [12, 20], "register_module_fix": [12, 27], "register_module_valid": [12, 27], "schedul": 12, "manag": [12, 17], "dpmultiheadattent": [12, 13], "dprnn": [12, 13], "pack": [12, 26], "uniform": [12, 26], "sgd": [12, 17, 20, 21], "page": 12, "ddpoptim": 15, "max_grad_norm": [15, 16, 17, 18, 20], "expected_batch_s": [15, 16, 17, 18], "secure_mod": [15, 16, 17, 18, 20], "compat": [15, 16, 20, 27], "norm": [15, 16, 17, 18, 20, 24], "denomin": [15, 16, 17, 18], "requir": [15, 16, 17, 18, 20, 22, 27], "approach": [15, 16, 17, 18], "robust": [15, 16, 17, 18], "point": [15, 16, 17, 18, 20, 24], "arithmet": [15, 16, 17, 18, 20], "attack": [15, 16, 17, 18, 20], "_generate_nois": [15, 16, 17, 18, 20], "add_nois": [15, 16, 17, 19], "closur": [15, 16, 17], "reevalu": [15, 16, 17], "specifi": [15, 17, 22], "ddp_perlayeroptim": 16, "strategi": [16, 18], "properti": [16, 17], "accumulated_iter": [16, 17, 19], "yet": [16, 17], "In": [16, 17, 25], "word": [16, 17], "track": [16, 17], "done": [16, 17], "real": [16, 17], "clip_and_accumul": [16, 17, 18, 19], "pre_step": [16, 17, 19], "action": [16, 17, 24], "befor": [16, 17], "simpledistributedperlayeroptim": [16, 19], "dpoptimz": 17, "therefor": 17, "high": 17, "look": [17, 27], "abov": 17, "threshold": 17, "calibr": 17, "std": 17, "mycustommodel": [17, 20, 27], "lr": [17, 20], "dp_optim": 17, "attach_step_hook": [17, 19], "fn": 17, "execut": 17, "commonli": 17, "signatur": [17, 27], "foo": 17, "flat": [17, 20, 24], "scale_grad": [17, 19], "divid": [17, 25], "signal_skip_step": [17, 19], "do_skip": 17, "queue": 17, "latest": 17, "proce": 17, "touch": 17, "virtual": 17, "footprint": 17, "entri": [17, 20], "hold": [17, 27], "Its": 17, "content": 17, "differ": [17, 25], "common": 17, "characterist": 17, "itself": 17, "NOT": 17, "id": 17, "param_group": 17, "group": 17, "metadata": 17, "learn": 17, "decai": 17, "well": 17, "mai": [17, 27], "zip": 17, "match": 17, "verif": 17, "might": 17, "someth": 17, "momentum_buff": 17, "weight_decai": 17, "001": 17, "set_to_non": 17, "never": 17, "regular": 17, "perlayeroptim": 18, "privacy_engin": 20, "prv": 20, "main": 20, "api": 20, "encapsul": [20, 27], "been": 20, "expos": 20, "make_priv": 20, "privat": 20, "counterpart": 20, "demo_dataload": 20, "continu": 20, "prvaccount": 20, "strong": 20, "guarante": 20, "shuffl": [20, 25], "oppos": [20, 22], "pseudo": 20, "rng": 20, "vanilla": 20, "prevent": 20, "torchcsprng": 20, "get_compatible_modul": 20, "fix": [20, 27], "deep": 20, "close": 20, "spent": 20, "is_compat": 20, "task": 20, "compon": 20, "poisson_sampl": 20, "noise_gener": 20, "grad_sample_mod": 20, "relat": 20, "respons": 20, "act": 20, "now": 20, "much": 20, "higher": 20, "unchang": 20, "technic": 20, "fit": 20, "assumpt": 20, "made": [20, 27], "good": 20, "approxim": 20, "unfeas": 20, "per_lay": 20, "adapt": 20, "prefer": 20, "combin": 20, "notabl": 20, "gain": 20, "around": 20, "brand": 20, "possibli": 20, "make_private_with_epsilon": 20, "version": 20, "achiev": 20, "metric": 20, "inform": 20, "leak": 20, "intend": 20, "reli": 20, "appropri": 20, "save_checkpoint": 20, "path": 20, "noise_schedul": 20, "grad_clip_schedul": 20, "checkpoint_dict": 20, "module_state_dict_kwarg": 20, "torch_save_kwarg": 20, "pathlik": 20, "binaryio": 20, "io": 20, "byte": 20, "_noiseschedul": 20, "whose": [20, 22], "_gradclipschedul": 20, "fill": 20, "checkpoint": 20, "unsupportedmoduleerror": [20, 27], "incompat": 20, "module_util": 22, "are_state_dict_equ": [22, 26], "sd1": 22, "sd2": 22, "compar": 22, "log": 22, "discrep": 22, "clone_modul": [22, 26], "handi": 22, "clone": 22, "deepcopi": 22, "easier": 22, "serial": 22, "bytesio": 22, "read": 22, "get_submodul": [22, 26], "pasta": 22, "9": 22, "8": 22, "favour": 22, "onc": 22, "abandon": 22, "doc": 22, "stabl": 22, "highlight": 22, "string": [22, 24], "attributeerror": 22, "parametrized_modul": [22, 26], "recurs": 22, "those": 22, "organ": 22, "requires_grad": [22, 26], "examin": 22, "trainable_modul": [22, 26], "trainabl": 22, "ie": 22, "trainable_paramet": [22, 26], "packed_sequ": 23, "compute_seq_length": [23, 26], "packed_padded_sequ": 23, "running_seq_length": 23, "stat": 24, "tensor_util": 24, "calc_sample_norm": [24, 26], "named_param": 24, "overal": 24, "0th": 24, "t1": 24, "rand": 24, "t2": 24, "calc_sample_norms_one_lay": [24, 26], "filter_dilated_row": [24, 26], "dilat": 24, "dilated_kernel_s": 24, "kernel_s": 24, "helper": 24, "row": 24, "slice": 24, "unfold": 24, "unfold3d": [24, 26], "c": 24, "d_out": 24, "h_out": 24, "w_out": 24, "kernel": 24, "definit": 24, "sum_over_all_but_batch_and_last_n": [24, 26], "n_dim": 24, "exclud": 24, "keep": 24, "ones": 24, "unfold2d": [24, 26], "pad": 24, "stride": 24, "extract": 24, "slide": 24, "local": [24, 25], "4d": 24, "imag": 24, "5d": 24, "w": 24, "implicit": 24, "side": 24, "spatial": 24, "space": 24, "np": 24, "product": 24, "6": 24, "7": 24, "arang": 24, "view": 24, "32": 24, "120": 24, "uniform_sampl": 25, "total_s": 25, "shuffle_se": 25, "follow": 25, "among": 25, "replica": 25, "plu": 25, "minu": 25, "independ": 25, "form": 25, "particular": 25, "num_replica": 25, "draw": 25, "seed": 25, "across": 25, "item": 25, "round": 25, "set_epoch": [25, 26], "yield": 25, "num_sampl": 25, "module_valid": 27, "work": 27, "namespac": 27, "fixer": 27, "sub_modul": 27, "root": 27, "arbitrari": 27, "fix_and_valid": 27, "failur": 27, "is_valid": 27, "boolean": 27, "target_class_or_class": 27, "validator_class": 27, "decor": 27, "invok": 27, "incompatobl": 27, "own": 27, "registri": 27, "def": 27, "help": 27, "insid": 27, "under": 27, "unsupportederror": 27}, "objects": {"opacus.accountants": [[2, 0, 0, "-", "accountant"], [1, 0, 0, "-", "gdp"], [3, 0, 0, "-", "rdp"], [4, 0, 0, "-", "utils"]], "opacus.accountants.accountant": [[2, 1, 1, "", "IAccountant"]], "opacus.accountants.accountant.IAccountant": [[2, 2, 1, "", "get_epsilon"], [2, 2, 1, "", "get_optimizer_hook_fn"], [2, 2, 1, "", "load_state_dict"], [2, 2, 1, "", "mechanism"], [2, 2, 1, "", "state_dict"], [2, 2, 1, "", "step"]], "opacus.accountants.gdp": [[1, 1, 1, "", "GaussianAccountant"]], "opacus.accountants.gdp.GaussianAccountant": [[1, 2, 1, "", "get_epsilon"], [1, 2, 1, "", "mechanism"], [1, 2, 1, "", "step"]], "opacus.accountants.rdp": [[3, 1, 1, "", "RDPAccountant"]], "opacus.accountants.rdp.RDPAccountant": [[3, 2, 1, "", "get_epsilon"], [3, 2, 1, "", "mechanism"], [3, 2, 1, "", "step"]], "opacus.accountants.utils": [[4, 3, 1, "", "get_noise_multiplier"]], "opacus": [[7, 0, 0, "-", "data_loader"], [8, 0, 0, "-", "distributed"], [20, 0, 0, "-", "privacy_engine"]], "opacus.data_loader": [[7, 1, 1, "", "DPDataLoader"], [7, 3, 1, "", "collate"], [7, 3, 1, "", "dtype_safe"], [7, 3, 1, "", "shape_safe"], [7, 3, 1, "", "switch_generator"], [7, 3, 1, "", "wrap_collate_with_empty"]], "opacus.data_loader.DPDataLoader": [[7, 2, 1, "", "from_data_loader"]], "opacus.distributed": [[8, 1, 1, "", "DifferentiallyPrivateDistributedDataParallel"], [8, 3, 1, "", "average_gradients"]], "opacus.distributed.DifferentiallyPrivateDistributedDataParallel": [[8, 2, 1, "", "forward"]], "opacus.grad_sample": [[11, 0, 0, "-", "grad_sample_module"]], "opacus.grad_sample.grad_sample_module": [[11, 1, 1, "", "GradSampleModule"], [11, 3, 1, "", "create_or_accumulate_grad_sample"]], "opacus.grad_sample.grad_sample_module.GradSampleModule": [[11, 2, 1, "", "add_hooks"], [11, 2, 1, "", "allow_grad_accumulation"], [11, 2, 1, "", "capture_backprops_hook"], [11, 2, 1, "", "disable_hooks"], [11, 2, 1, "", "enable_hooks"], [11, 2, 1, "", "forbid_grad_accumulation"], [11, 2, 1, "", "forward"], [11, 2, 1, "", "is_supported"], [11, 2, 1, "", "rearrange_grad_samples"], [11, 2, 1, "", "remove_hooks"], [11, 2, 1, "", "validate"]], "opacus.layers": [[9, 0, 0, "-", "dp_multihead_attention"], [10, 0, 0, "-", "dp_rnn"]], "opacus.layers.dp_multihead_attention": [[9, 1, 1, "", "DPMultiheadAttention"], [9, 1, 1, "", "SequenceBias"]], "opacus.layers.dp_multihead_attention.DPMultiheadAttention": [[9, 2, 1, "", "forward"], [9, 2, 1, "", "load_state_dict"], [9, 2, 1, "", "state_dict"]], "opacus.layers.dp_multihead_attention.SequenceBias": [[9, 4, 1, "", "bias"], [9, 2, 1, "", "forward"]], "opacus.layers.dp_rnn": [[10, 1, 1, "", "DPGRU"], [10, 1, 1, "", "DPGRUCell"], [10, 1, 1, "", "DPLSTM"], [10, 1, 1, "", "DPLSTMCell"], [10, 1, 1, "", "DPRNN"], [10, 1, 1, "", "DPRNNBase"], [10, 1, 1, "", "DPRNNCell"], [10, 1, 1, "", "DPRNNCellBase"], [10, 1, 1, "", "RNNLinear"], [10, 3, 1, "", "apply_permutation"]], "opacus.layers.dp_rnn.DPGRUCell": [[10, 2, 1, "", "forward"]], "opacus.layers.dp_rnn.DPLSTMCell": [[10, 2, 1, "", "forward"]], "opacus.layers.dp_rnn.DPRNNBase": [[10, 2, 1, "", "forward"], [10, 2, 1, "", "forward_layer"], [10, 2, 1, "", "iterate_layers"]], "opacus.layers.dp_rnn.DPRNNCell": [[10, 2, 1, "", "forward"]], "opacus.optimizers": [[16, 0, 0, "-", "ddp_perlayeroptimizer"], [15, 0, 0, "-", "ddpoptimizer"], [17, 0, 0, "-", "optimizer"], [18, 0, 0, "-", "perlayeroptimizer"]], "opacus.optimizers.ddp_perlayeroptimizer": [[16, 1, 1, "", "DistributedPerLayerOptimizer"], [16, 1, 1, "", "SimpleDistributedPerLayerOptimizer"]], "opacus.optimizers.ddp_perlayeroptimizer.DistributedPerLayerOptimizer": [[16, 5, 1, "", "accumulated_iterations"], [16, 2, 1, "", "add_noise"], [16, 2, 1, "", "clip_and_accumulate"], [16, 2, 1, "", "pre_step"]], "opacus.optimizers.ddpoptimizer": [[15, 1, 1, "", "DistributedDPOptimizer"]], "opacus.optimizers.ddpoptimizer.DistributedDPOptimizer": [[15, 2, 1, "", "add_noise"], [15, 2, 1, "", "step"]], "opacus.optimizers.optimizer": [[17, 1, 1, "", "DPOptimizer"]], "opacus.optimizers.optimizer.DPOptimizer": [[17, 5, 1, "", "accumulated_iterations"], [17, 2, 1, "", "add_noise"], [17, 2, 1, "", "attach_step_hook"], [17, 2, 1, "", "clip_and_accumulate"], [17, 5, 1, "", "grad_samples"], [17, 2, 1, "", "load_state_dict"], [17, 5, 1, "", "params"], [17, 2, 1, "", "pre_step"], [17, 2, 1, "", "scale_grad"], [17, 2, 1, "", "signal_skip_step"], [17, 2, 1, "", "state_dict"], [17, 2, 1, "", "step"], [17, 2, 1, "", "zero_grad"]], "opacus.optimizers.perlayeroptimizer": [[18, 1, 1, "", "DPPerLayerOptimizer"]], "opacus.optimizers.perlayeroptimizer.DPPerLayerOptimizer": [[18, 2, 1, "", "clip_and_accumulate"]], "opacus.privacy_engine": [[20, 1, 1, "", "PrivacyEngine"]], "opacus.privacy_engine.PrivacyEngine": [[20, 2, 1, "", "get_compatible_module"], [20, 2, 1, "", "get_epsilon"], [20, 2, 1, "", "is_compatible"], [20, 2, 1, "", "make_private"], [20, 2, 1, "", "make_private_with_epsilon"], [20, 2, 1, "", "save_checkpoint"], [20, 2, 1, "", "validate"]], "opacus.scripts": [[6, 0, 0, "-", "compute_dp_sgd_privacy"]], "opacus.scripts.compute_dp_sgd_privacy": [[6, 3, 1, "", "compute_dp_sgd_privacy"]], "opacus.utils": [[5, 0, 0, "-", "batch_memory_manager"], [22, 0, 0, "-", "module_utils"], [23, 0, 0, "-", "packed_sequences"], [24, 0, 0, "-", "tensor_utils"], [25, 0, 0, "-", "uniform_sampler"]], "opacus.utils.batch_memory_manager": [[5, 1, 1, "", "BatchMemoryManager"], [5, 1, 1, "", "BatchSplittingSampler"], [5, 3, 1, "", "wrap_data_loader"]], "opacus.utils.module_utils": [[22, 3, 1, "", "are_state_dict_equal"], [22, 3, 1, "", "clone_module"], [22, 3, 1, "", "get_submodule"], [22, 3, 1, "", "parametrized_modules"], [22, 3, 1, "", "requires_grad"], [22, 3, 1, "", "trainable_modules"], [22, 3, 1, "", "trainable_parameters"]], "opacus.utils.packed_sequences": [[23, 3, 1, "", "compute_seq_lengths"]], "opacus.utils.tensor_utils": [[24, 3, 1, "", "calc_sample_norms"], [24, 3, 1, "", "calc_sample_norms_one_layer"], [24, 3, 1, "", "filter_dilated_rows"], [24, 3, 1, "", "sum_over_all_but_batch_and_last_n"], [24, 3, 1, "", "unfold2d"], [24, 3, 1, "", "unfold3d"]], "opacus.utils.uniform_sampler": [[25, 1, 1, "", "DistributedUniformWithReplacementSampler"], [25, 1, 1, "", "UniformWithReplacementSampler"]], "opacus.utils.uniform_sampler.DistributedUniformWithReplacementSampler": [[25, 2, 1, "", "set_epoch"]], "opacus.validators": [[27, 0, 0, "-", "module_validator"], [27, 0, 0, "-", "utils"]], "opacus.validators.module_validator": [[27, 1, 1, "", "ModuleValidator"]], "opacus.validators.module_validator.ModuleValidator": [[27, 2, 1, "", "fix"], [27, 2, 1, "", "fix_and_validate"], [27, 2, 1, "", "is_valid"], [27, 2, 1, "", "validate"]], "opacus.validators.utils": [[27, 3, 1, "", "register_module_fixer"], [27, 3, 1, "", "register_module_validator"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:function", "4": "py:attribute", "5": "py:property"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "function", "Python function"], "4": ["py", "attribute", "Python attribute"], "5": ["py", "property", "Python property"]}, "titleterms": {"privaci": [0, 6, 20], "account": 0, "gaussianaccount": 1, "iaccount": 2, "rdpaccount": 3, "util": [4, 22, 24, 26], "batch": 5, "memori": 5, "manag": 5, "comput": 6, "dp": [6, 7, 13], "sgd": 6, "data": 7, "loader": 7, "distribut": 8, "dpmultiheadattent": 9, "dprnn": 10, "gradsamplemodul": 11, "opacu": 12, "api": 12, "refer": 12, "indic": 12, "tabl": 12, "layer": 13, "nois": 14, "schedul": 14, "distributeddpoptim": 15, "distributedperlayeroptim": 16, "dpoptim": 17, "dpperlayeroptim": 18, "optim": 19, "engin": 20, "script": 21, "modul": 22, "pack": 23, "sequenc": 23, "tensor": 24, "uniform": 25, "sampler": 25, "modulevalid": 27}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.todo": 2, "sphinx.ext.viewcode": 1, "sphinx.ext.intersphinx": 1, "sphinx": 60}, "alltitles": {"Privacy Accounting": [[0, "privacy-accounting"]], "GaussianAccountant": [[1, "module-opacus.accountants.gdp"]], "IAccountant": [[2, "module-opacus.accountants.accountant"]], "RDPAccountant": [[3, "module-opacus.accountants.rdp"]], "Utils": [[4, "module-opacus.accountants.utils"], [26, "utils"]], "Batch Memory Manager": [[5, "batch-memory-manager"]], "Compute DP-SGD Privacy": [[6, "module-opacus.scripts.compute_dp_sgd_privacy"]], "DP Data Loader": [[7, "module-opacus.data_loader"]], "Distributed": [[8, "module-opacus.distributed"]], "DPMultiheadAttention": [[9, "module-opacus.layers.dp_multihead_attention"]], "DPRNN": [[10, "module-opacus.layers.dp_rnn"]], "GradSampleModule": [[11, "module-opacus.grad_sample.grad_sample_module"]], "Opacus API Reference": [[12, "opacus-api-reference"]], "API Reference": [[12, null]], "Indices and Tables": [[12, "indices-and-tables"]], "DP Layers": [[13, "dp-layers"]], "Noise Scheduler": [[14, "noise-scheduler"]], "DistributedDPOptimizer": [[15, "module-opacus.optimizers.ddpoptimizer"]], "DistributedPerLayerOptimizer": [[16, "module-opacus.optimizers.ddp_perlayeroptimizer"]], "DPOptimizer": [[17, "module-opacus.optimizers.optimizer"]], "DPPerLayerOptimizer": [[18, "module-opacus.optimizers.perlayeroptimizer"]], "Optimizers": [[19, "optimizers"]], "Privacy Engine": [[20, "module-opacus.privacy_engine"]], "Scripts": [[21, "scripts"]], "Module Utils": [[22, "module-opacus.utils.module_utils"]], "Packed Sequences": [[23, "module-opacus.utils.packed_sequences"]], "Tensor Utils": [[24, "module-opacus.utils.tensor_utils"]], "Uniform Sampler": [[25, "module-opacus.utils.uniform_sampler"]], "ModuleValidator": [[27, "module-opacus.validators.module_validator"]]}, "indexentries": {"gaussianaccountant (class in opacus.accountants.gdp)": [[1, "opacus.accountants.gdp.GaussianAccountant"]], "get_epsilon() (opacus.accountants.gdp.gaussianaccountant method)": [[1, "opacus.accountants.gdp.GaussianAccountant.get_epsilon"]], "mechanism() (opacus.accountants.gdp.gaussianaccountant class method)": [[1, "opacus.accountants.gdp.GaussianAccountant.mechanism"]], "module": [[1, "module-opacus.accountants.gdp"], [2, "module-opacus.accountants.accountant"], [3, "module-opacus.accountants.rdp"], [4, "module-opacus.accountants.utils"], [5, "module-opacus.utils.batch_memory_manager"], [6, "module-opacus.scripts.compute_dp_sgd_privacy"], [7, "module-opacus.data_loader"], [8, "module-opacus.distributed"], [9, "module-opacus.layers.dp_multihead_attention"], [10, "module-opacus.layers.dp_rnn"], [11, "module-opacus.grad_sample.grad_sample_module"], [15, "module-opacus.optimizers.ddpoptimizer"], [16, "module-opacus.optimizers.ddp_perlayeroptimizer"], [17, "module-opacus.optimizers.optimizer"], [18, "module-opacus.optimizers.perlayeroptimizer"], [20, "module-opacus.privacy_engine"], [22, "module-opacus.utils.module_utils"], [23, "module-opacus.utils.packed_sequences"], [24, "module-opacus.utils.tensor_utils"], [25, "module-opacus.utils.uniform_sampler"], [27, "module-opacus.validators.module_validator"], [27, "module-opacus.validators.utils"]], "opacus.accountants.gdp": [[1, "module-opacus.accountants.gdp"]], "step() (opacus.accountants.gdp.gaussianaccountant method)": [[1, "opacus.accountants.gdp.GaussianAccountant.step"]], "iaccountant (class in opacus.accountants.accountant)": [[2, "opacus.accountants.accountant.IAccountant"]], "get_epsilon() (opacus.accountants.accountant.iaccountant method)": [[2, "opacus.accountants.accountant.IAccountant.get_epsilon"]], "get_optimizer_hook_fn() (opacus.accountants.accountant.iaccountant method)": [[2, "opacus.accountants.accountant.IAccountant.get_optimizer_hook_fn"]], "load_state_dict() (opacus.accountants.accountant.iaccountant method)": [[2, "opacus.accountants.accountant.IAccountant.load_state_dict"]], "mechanism() (opacus.accountants.accountant.iaccountant class method)": [[2, "opacus.accountants.accountant.IAccountant.mechanism"]], "opacus.accountants.accountant": [[2, "module-opacus.accountants.accountant"]], "state_dict() (opacus.accountants.accountant.iaccountant method)": [[2, "opacus.accountants.accountant.IAccountant.state_dict"]], "step() (opacus.accountants.accountant.iaccountant method)": [[2, "opacus.accountants.accountant.IAccountant.step"]], "rdpaccountant (class in opacus.accountants.rdp)": [[3, "opacus.accountants.rdp.RDPAccountant"]], "get_epsilon() (opacus.accountants.rdp.rdpaccountant method)": [[3, "opacus.accountants.rdp.RDPAccountant.get_epsilon"]], "mechanism() (opacus.accountants.rdp.rdpaccountant class method)": [[3, "opacus.accountants.rdp.RDPAccountant.mechanism"]], "opacus.accountants.rdp": [[3, "module-opacus.accountants.rdp"]], "step() (opacus.accountants.rdp.rdpaccountant method)": [[3, "opacus.accountants.rdp.RDPAccountant.step"]], "get_noise_multiplier() (in module opacus.accountants.utils)": [[4, "opacus.accountants.utils.get_noise_multiplier"]], "opacus.accountants.utils": [[4, "module-opacus.accountants.utils"]], "batchmemorymanager (class in opacus.utils.batch_memory_manager)": [[5, "opacus.utils.batch_memory_manager.BatchMemoryManager"]], "batchsplittingsampler (class in opacus.utils.batch_memory_manager)": [[5, "opacus.utils.batch_memory_manager.BatchSplittingSampler"]], "opacus.utils.batch_memory_manager": [[5, "module-opacus.utils.batch_memory_manager"]], "wrap_data_loader() (in module opacus.utils.batch_memory_manager)": [[5, "opacus.utils.batch_memory_manager.wrap_data_loader"]], "compute_dp_sgd_privacy() (in module opacus.scripts.compute_dp_sgd_privacy)": [[6, "opacus.scripts.compute_dp_sgd_privacy.compute_dp_sgd_privacy"]], "opacus.scripts.compute_dp_sgd_privacy": [[6, "module-opacus.scripts.compute_dp_sgd_privacy"]], "dpdataloader (class in opacus.data_loader)": [[7, "opacus.data_loader.DPDataLoader"]], "collate() (in module opacus.data_loader)": [[7, "opacus.data_loader.collate"]], "dtype_safe() (in module opacus.data_loader)": [[7, "opacus.data_loader.dtype_safe"]], "from_data_loader() (opacus.data_loader.dpdataloader class method)": [[7, "opacus.data_loader.DPDataLoader.from_data_loader"]], "opacus.data_loader": [[7, "module-opacus.data_loader"]], "shape_safe() (in module opacus.data_loader)": [[7, "opacus.data_loader.shape_safe"]], "switch_generator() (in module opacus.data_loader)": [[7, "opacus.data_loader.switch_generator"]], "wrap_collate_with_empty() (in module opacus.data_loader)": [[7, "opacus.data_loader.wrap_collate_with_empty"]], "differentiallyprivatedistributeddataparallel (class in opacus.distributed)": [[8, "opacus.distributed.DifferentiallyPrivateDistributedDataParallel"]], "average_gradients() (in module opacus.distributed)": [[8, "opacus.distributed.average_gradients"]], "forward() (opacus.distributed.differentiallyprivatedistributeddataparallel method)": [[8, "opacus.distributed.DifferentiallyPrivateDistributedDataParallel.forward"]], "opacus.distributed": [[8, "module-opacus.distributed"]], "dpmultiheadattention (class in opacus.layers.dp_multihead_attention)": [[9, "opacus.layers.dp_multihead_attention.DPMultiheadAttention"]], "sequencebias (class in opacus.layers.dp_multihead_attention)": [[9, "opacus.layers.dp_multihead_attention.SequenceBias"]], "bias (opacus.layers.dp_multihead_attention.sequencebias attribute)": [[9, "opacus.layers.dp_multihead_attention.SequenceBias.bias"]], "forward() (opacus.layers.dp_multihead_attention.dpmultiheadattention method)": [[9, "opacus.layers.dp_multihead_attention.DPMultiheadAttention.forward"]], "forward() (opacus.layers.dp_multihead_attention.sequencebias method)": [[9, "opacus.layers.dp_multihead_attention.SequenceBias.forward"]], "load_state_dict() (opacus.layers.dp_multihead_attention.dpmultiheadattention method)": [[9, "opacus.layers.dp_multihead_attention.DPMultiheadAttention.load_state_dict"]], "opacus.layers.dp_multihead_attention": [[9, "module-opacus.layers.dp_multihead_attention"]], "state_dict() (opacus.layers.dp_multihead_attention.dpmultiheadattention method)": [[9, "opacus.layers.dp_multihead_attention.DPMultiheadAttention.state_dict"]], "dpgru (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPGRU"]], "dpgrucell (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPGRUCell"]], "dplstm (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPLSTM"]], "dplstmcell (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPLSTMCell"]], "dprnn (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPRNN"]], "dprnnbase (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPRNNBase"]], "dprnncell (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPRNNCell"]], "dprnncellbase (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPRNNCellBase"]], "rnnlinear (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.RNNLinear"]], "apply_permutation() (in module opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.apply_permutation"]], "forward() (opacus.layers.dp_rnn.dpgrucell method)": [[10, "opacus.layers.dp_rnn.DPGRUCell.forward"]], "forward() (opacus.layers.dp_rnn.dplstmcell method)": [[10, "opacus.layers.dp_rnn.DPLSTMCell.forward"]], "forward() (opacus.layers.dp_rnn.dprnnbase method)": [[10, "opacus.layers.dp_rnn.DPRNNBase.forward"]], "forward() (opacus.layers.dp_rnn.dprnncell method)": [[10, "opacus.layers.dp_rnn.DPRNNCell.forward"]], "forward_layer() (opacus.layers.dp_rnn.dprnnbase method)": [[10, "opacus.layers.dp_rnn.DPRNNBase.forward_layer"]], "iterate_layers() (opacus.layers.dp_rnn.dprnnbase method)": [[10, "opacus.layers.dp_rnn.DPRNNBase.iterate_layers"]], "opacus.layers.dp_rnn": [[10, "module-opacus.layers.dp_rnn"]], "gradsamplemodule (class in opacus.grad_sample.grad_sample_module)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule"]], "add_hooks() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.add_hooks"]], "allow_grad_accumulation() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.allow_grad_accumulation"]], "capture_backprops_hook() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.capture_backprops_hook"]], "create_or_accumulate_grad_sample() (in module opacus.grad_sample.grad_sample_module)": [[11, "opacus.grad_sample.grad_sample_module.create_or_accumulate_grad_sample"]], "disable_hooks() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.disable_hooks"]], "enable_hooks() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.enable_hooks"]], "forbid_grad_accumulation() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.forbid_grad_accumulation"]], "forward() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.forward"]], "is_supported() (opacus.grad_sample.grad_sample_module.gradsamplemodule class method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.is_supported"]], "opacus.grad_sample.grad_sample_module": [[11, "module-opacus.grad_sample.grad_sample_module"]], "rearrange_grad_samples() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.rearrange_grad_samples"]], "remove_hooks() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.remove_hooks"]], "validate() (opacus.grad_sample.grad_sample_module.gradsamplemodule class method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.validate"]], "distributeddpoptimizer (class in opacus.optimizers.ddpoptimizer)": [[15, "opacus.optimizers.ddpoptimizer.DistributedDPOptimizer"]], "add_noise() (opacus.optimizers.ddpoptimizer.distributeddpoptimizer method)": [[15, "opacus.optimizers.ddpoptimizer.DistributedDPOptimizer.add_noise"]], "opacus.optimizers.ddpoptimizer": [[15, "module-opacus.optimizers.ddpoptimizer"]], "step() (opacus.optimizers.ddpoptimizer.distributeddpoptimizer method)": [[15, "opacus.optimizers.ddpoptimizer.DistributedDPOptimizer.step"]], "distributedperlayeroptimizer (class in opacus.optimizers.ddp_perlayeroptimizer)": [[16, "opacus.optimizers.ddp_perlayeroptimizer.DistributedPerLayerOptimizer"]], "simpledistributedperlayeroptimizer (class in opacus.optimizers.ddp_perlayeroptimizer)": [[16, "opacus.optimizers.ddp_perlayeroptimizer.SimpleDistributedPerLayerOptimizer"]], "accumulated_iterations (opacus.optimizers.ddp_perlayeroptimizer.distributedperlayeroptimizer property)": [[16, "opacus.optimizers.ddp_perlayeroptimizer.DistributedPerLayerOptimizer.accumulated_iterations"]], "add_noise() (opacus.optimizers.ddp_perlayeroptimizer.distributedperlayeroptimizer method)": [[16, "opacus.optimizers.ddp_perlayeroptimizer.DistributedPerLayerOptimizer.add_noise"]], "clip_and_accumulate() (opacus.optimizers.ddp_perlayeroptimizer.distributedperlayeroptimizer method)": [[16, "opacus.optimizers.ddp_perlayeroptimizer.DistributedPerLayerOptimizer.clip_and_accumulate"]], "opacus.optimizers.ddp_perlayeroptimizer": [[16, "module-opacus.optimizers.ddp_perlayeroptimizer"]], "pre_step() (opacus.optimizers.ddp_perlayeroptimizer.distributedperlayeroptimizer method)": [[16, "opacus.optimizers.ddp_perlayeroptimizer.DistributedPerLayerOptimizer.pre_step"]], "dpoptimizer (class in opacus.optimizers.optimizer)": [[17, "opacus.optimizers.optimizer.DPOptimizer"]], "accumulated_iterations (opacus.optimizers.optimizer.dpoptimizer property)": [[17, "opacus.optimizers.optimizer.DPOptimizer.accumulated_iterations"]], "add_noise() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.add_noise"]], "attach_step_hook() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.attach_step_hook"]], "clip_and_accumulate() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.clip_and_accumulate"]], "grad_samples (opacus.optimizers.optimizer.dpoptimizer property)": [[17, "opacus.optimizers.optimizer.DPOptimizer.grad_samples"]], "load_state_dict() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.load_state_dict"]], "opacus.optimizers.optimizer": [[17, "module-opacus.optimizers.optimizer"]], "params (opacus.optimizers.optimizer.dpoptimizer property)": [[17, "opacus.optimizers.optimizer.DPOptimizer.params"]], "pre_step() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.pre_step"]], "scale_grad() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.scale_grad"]], "signal_skip_step() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.signal_skip_step"]], "state_dict() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.state_dict"]], "step() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.step"]], "zero_grad() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.zero_grad"]], "dpperlayeroptimizer (class in opacus.optimizers.perlayeroptimizer)": [[18, "opacus.optimizers.perlayeroptimizer.DPPerLayerOptimizer"]], "clip_and_accumulate() (opacus.optimizers.perlayeroptimizer.dpperlayeroptimizer method)": [[18, "opacus.optimizers.perlayeroptimizer.DPPerLayerOptimizer.clip_and_accumulate"]], "opacus.optimizers.perlayeroptimizer": [[18, "module-opacus.optimizers.perlayeroptimizer"]], "privacyengine (class in opacus.privacy_engine)": [[20, "opacus.privacy_engine.PrivacyEngine"]], "get_compatible_module() (opacus.privacy_engine.privacyengine class method)": [[20, "opacus.privacy_engine.PrivacyEngine.get_compatible_module"]], "get_epsilon() (opacus.privacy_engine.privacyengine method)": [[20, "opacus.privacy_engine.PrivacyEngine.get_epsilon"]], "is_compatible() (opacus.privacy_engine.privacyengine method)": [[20, "opacus.privacy_engine.PrivacyEngine.is_compatible"]], "make_private() (opacus.privacy_engine.privacyengine method)": [[20, "opacus.privacy_engine.PrivacyEngine.make_private"]], "make_private_with_epsilon() (opacus.privacy_engine.privacyengine method)": [[20, "opacus.privacy_engine.PrivacyEngine.make_private_with_epsilon"]], "opacus.privacy_engine": [[20, "module-opacus.privacy_engine"]], "save_checkpoint() (opacus.privacy_engine.privacyengine method)": [[20, "opacus.privacy_engine.PrivacyEngine.save_checkpoint"]], "validate() (opacus.privacy_engine.privacyengine method)": [[20, "opacus.privacy_engine.PrivacyEngine.validate"]], "are_state_dict_equal() (in module opacus.utils.module_utils)": [[22, "opacus.utils.module_utils.are_state_dict_equal"]], "clone_module() (in module opacus.utils.module_utils)": [[22, "opacus.utils.module_utils.clone_module"]], "get_submodule() (in module opacus.utils.module_utils)": [[22, "opacus.utils.module_utils.get_submodule"]], "opacus.utils.module_utils": [[22, "module-opacus.utils.module_utils"]], "parametrized_modules() (in module opacus.utils.module_utils)": [[22, "opacus.utils.module_utils.parametrized_modules"]], "requires_grad() (in module opacus.utils.module_utils)": [[22, "opacus.utils.module_utils.requires_grad"]], "trainable_modules() (in module opacus.utils.module_utils)": [[22, "opacus.utils.module_utils.trainable_modules"]], "trainable_parameters() (in module opacus.utils.module_utils)": [[22, "opacus.utils.module_utils.trainable_parameters"]], "compute_seq_lengths() (in module opacus.utils.packed_sequences)": [[23, "opacus.utils.packed_sequences.compute_seq_lengths"]], "opacus.utils.packed_sequences": [[23, "module-opacus.utils.packed_sequences"]], "calc_sample_norms() (in module opacus.utils.tensor_utils)": [[24, "opacus.utils.tensor_utils.calc_sample_norms"]], "calc_sample_norms_one_layer() (in module opacus.utils.tensor_utils)": [[24, "opacus.utils.tensor_utils.calc_sample_norms_one_layer"]], "filter_dilated_rows() (in module opacus.utils.tensor_utils)": [[24, "opacus.utils.tensor_utils.filter_dilated_rows"]], "opacus.utils.tensor_utils": [[24, "module-opacus.utils.tensor_utils"]], "sum_over_all_but_batch_and_last_n() (in module opacus.utils.tensor_utils)": [[24, "opacus.utils.tensor_utils.sum_over_all_but_batch_and_last_n"]], "unfold2d() (in module opacus.utils.tensor_utils)": [[24, "opacus.utils.tensor_utils.unfold2d"]], "unfold3d() (in module opacus.utils.tensor_utils)": [[24, "opacus.utils.tensor_utils.unfold3d"]], "distributeduniformwithreplacementsampler (class in opacus.utils.uniform_sampler)": [[25, "opacus.utils.uniform_sampler.DistributedUniformWithReplacementSampler"]], "uniformwithreplacementsampler (class in opacus.utils.uniform_sampler)": [[25, "opacus.utils.uniform_sampler.UniformWithReplacementSampler"]], "opacus.utils.uniform_sampler": [[25, "module-opacus.utils.uniform_sampler"]], "set_epoch() (opacus.utils.uniform_sampler.distributeduniformwithreplacementsampler method)": [[25, "opacus.utils.uniform_sampler.DistributedUniformWithReplacementSampler.set_epoch"]], "modulevalidator (class in opacus.validators.module_validator)": [[27, "opacus.validators.module_validator.ModuleValidator"]], "fix() (opacus.validators.module_validator.modulevalidator class method)": [[27, "opacus.validators.module_validator.ModuleValidator.fix"]], "fix_and_validate() (opacus.validators.module_validator.modulevalidator class method)": [[27, "opacus.validators.module_validator.ModuleValidator.fix_and_validate"]], "is_valid() (opacus.validators.module_validator.modulevalidator class method)": [[27, "opacus.validators.module_validator.ModuleValidator.is_valid"]], "opacus.validators.module_validator": [[27, "module-opacus.validators.module_validator"]], "opacus.validators.utils": [[27, "module-opacus.validators.utils"]], "register_module_fixer() (in module opacus.validators.utils)": [[27, "opacus.validators.utils.register_module_fixer"]], "register_module_validator() (in module opacus.validators.utils)": [[27, "opacus.validators.utils.register_module_validator"]], "validate() (opacus.validators.module_validator.modulevalidator class method)": [[27, "opacus.validators.module_validator.ModuleValidator.validate"]]}}) \ No newline at end of file +Search.setIndex({"docnames": ["accounting/accounting", "accounting/gdp", "accounting/iaccountant", "accounting/rdp", "accounting/utils", "batch_memory_manager", "compute_dp_sgd_privacy", "data_loader", "distributed", "dp_multihead_attention", "dp_rnn", "grad_sample_module", "index", "layers", "noise_scheduler", "optim/dp_ddp_optimizer", "optim/dp_ddp_per_layer_optimizer", "optim/dp_optimizer", "optim/dp_per_layer_optimizer", "optim/optimizers", "privacy_engine", "scripts", "utils/module_utils", "utils/packed_sequences", "utils/tensor_utils", "utils/uniform_sampler", "utils/utils", "validator"], "filenames": ["accounting/accounting.rst", "accounting/gdp.rst", "accounting/iaccountant.rst", "accounting/rdp.rst", "accounting/utils.rst", "batch_memory_manager.rst", "compute_dp_sgd_privacy.rst", "data_loader.rst", "distributed.rst", "dp_multihead_attention.rst", "dp_rnn.rst", "grad_sample_module.rst", "index.rst", "layers.rst", "noise_scheduler.rst", "optim/dp_ddp_optimizer.rst", "optim/dp_ddp_per_layer_optimizer.rst", "optim/dp_optimizer.rst", "optim/dp_per_layer_optimizer.rst", "optim/optimizers.rst", "privacy_engine.rst", "scripts.rst", "utils/module_utils.rst", "utils/packed_sequences.rst", "utils/tensor_utils.rst", "utils/uniform_sampler.rst", "utils/utils.rst", "validator.rst"], "titles": ["Privacy Accounting", "GaussianAccountant", "IAccountant", "RDPAccountant", "Utils", "Batch Memory Manager", "Compute DP-SGD Privacy", "DP Data Loader", "Distributed", "DPMultiheadAttention", "DPRNN", "GradSampleModule", "Opacus API Reference", "DP Layers", "Noise Scheduler", "DistributedDPOptimizer", "DistributedPerLayerOptimizer", "DPOptimizer", "DPPerLayerOptimizer", "Optimizers", "Privacy Engine", "Scripts", "Module Utils", "Packed Sequences", "Tensor Utils", "Uniform Sampler", "Utils", "ModuleValidator"], "terms": {"iaccount": [0, 12], "get_epsilon": [0, 1, 2, 3, 20], "get_optimizer_hook_fn": [0, 2], "load_state_dict": [0, 2, 9, 13, 17, 19], "mechan": [0, 1, 2, 3, 4, 6, 7, 20, 25], "state_dict": [0, 2, 9, 13, 17, 19, 20], "step": [0, 1, 2, 3, 4, 5, 6, 11, 15, 16, 17, 19, 25], "rdpaccount": [0, 12, 20], "gaussianaccount": [0, 12, 20], "util": [0, 5, 7, 12, 23, 25, 27], "get_noise_multipli": [0, 4], "class": [1, 2, 3, 5, 7, 8, 9, 10, 11, 15, 16, 17, 18, 20, 25, 27], "opacu": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 20, 22, 23, 24, 25, 27], "account": [1, 2, 3, 4, 6, 12, 16, 17, 20], "gdp": [1, 20], "sourc": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 20, 22, 23, 24, 25, 27], "delta": [1, 2, 3, 4, 6, 20], "poisson": [1, 7, 15, 16, 17, 18, 20, 25], "true": [1, 6, 7, 9, 10, 11, 15, 16, 17, 18, 20, 24, 25], "return": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 20, 22, 23, 24, 25, 27], "privaci": [1, 2, 3, 4, 12, 16, 17, 21], "budget": [1, 2, 3, 4, 6, 20], "epsilon": [1, 2, 3, 4, 6, 20], "expend": [1, 2, 3, 20], "so": [1, 2, 3, 7, 9, 11, 17, 20, 22], "far": [1, 2, 3, 20], "paramet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 20, 22, 23, 24, 25, 27], "float": [1, 2, 3, 4, 6, 7, 15, 16, 17, 18, 20, 25], "target": [1, 2, 3, 6, 20, 22], "bool": [1, 6, 7, 9, 10, 11, 15, 16, 17, 18, 20, 22, 24, 25, 27], "i": [1, 2, 5, 6, 7, 8, 9, 10, 11, 15, 16, 17, 18, 20, 22, 24, 25, 27], "input": [1, 5, 6, 7, 9, 10, 11, 20, 24], "batch": [1, 6, 7, 9, 10, 11, 12, 15, 16, 17, 18, 20, 23, 24, 25], "wa": [1, 5, 11, 17], "sampl": [1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 15, 16, 17, 18, 20, 24, 25], "via": [1, 7], "fals": [1, 7, 9, 10, 11, 15, 16, 17, 18, 20, 22, 27], "otherwis": [1, 7, 9, 11, 15, 17, 20, 22, 25], "type": [1, 2, 3, 4, 6, 7, 8, 9, 10, 11, 15, 16, 17, 20, 22, 23, 24, 25, 27], "classmethod": [1, 2, 3, 7, 11, 20, 27], "name": [1, 2, 3, 9, 24], "str": [1, 2, 3, 4, 9, 11, 15, 16, 17, 18, 20, 22, 24], "noise_multipli": [1, 2, 3, 6, 15, 16, 17, 18, 20], "sample_r": [1, 2, 3, 4, 6, 7, 25], "signal": [1, 2, 3, 17], "one": [1, 2, 3, 5, 7, 8, 9, 10, 11, 17, 20, 25], "optim": [1, 2, 3, 5, 6, 11, 12, 15, 16, 17, 18, 20], "current": [1, 2, 3, 5, 9, 11, 16, 17, 20], "nois": [1, 2, 3, 4, 6, 12, 15, 16, 17, 18, 20], "multipli": [1, 2, 3, 6, 15, 16, 17, 18], "rate": [1, 2, 3, 4, 6, 16, 17], "abstract": [2, 10], "arg": [2, 8, 10, 11], "kwarg": [2, 4, 7, 8, 11, 20, 27], "subclass": [2, 7, 8, 9, 10, 11, 17], "specif": [2, 10, 16, 17], "callback": 2, "function": [2, 6, 7, 8, 9, 10, 11, 15, 17, 20, 22, 23, 24, 27], "which": [2, 6, 7, 11, 17, 20, 25, 27], "can": [2, 5, 6, 7, 10, 11, 15, 16, 17, 18, 20, 22], "us": [2, 3, 4, 5, 7, 9, 10, 11, 15, 16, 17, 18, 20, 23, 25], "attach": [2, 17], "dpoptim": [2, 5, 12, 15, 16, 18, 19, 20], "param": [2, 11, 17, 19, 20, 24], "expect": [2, 7, 11, 17, 20, 25], "callabl": [2, 7, 15, 16, 17], "none": [2, 3, 4, 7, 8, 9, 10, 11, 15, 16, 17, 18, 20, 24, 25], "valid": [2, 11, 20, 27], "suppli": [2, 27], "popul": 2, "": [2, 4, 6, 7, 9, 10, 17, 20, 22, 23, 24], "state": [2, 8, 9, 10, 17, 20, 22], "dict": [2, 9, 17, 20, 22], "typevar": [2, 7], "t_state_dict": 2, "bound": [2, 20], "map": [2, 17], "ani": [2, 7, 11, 17, 20, 22], "load": [2, 9, 10, 17], "rais": [2, 6, 11, 20, 22, 27], "valueerror": [2, 6, 11], "invalid": [2, 11, 20], "cannot": 2, "destin": [2, 9], "dictionari": [2, 9, 17], "contain": [2, 9, 10, 17, 23, 24], "rtype": [2, 10], "option": [2, 3, 4, 7, 9, 15, 16, 17, 18, 20], "mappabl": 2, "object": [2, 5, 7, 9, 15, 16, 17, 18, 20, 25], "If": [2, 5, 6, 9, 10, 11, 17, 20, 22], "thi": [2, 5, 6, 7, 8, 9, 10, 11, 15, 17, 20, 22, 24, 25], "an": [2, 6, 7, 9, 10, 11, 17, 20, 22, 24, 27], "ordereddict": [2, 9], "creat": [2, 7, 9, 11, 23, 24], "default": [2, 7, 9, 10, 25], "rdp": [3, 4, 6, 20], "alpha": [3, 6], "list": [3, 5, 6, 7, 10, 11, 16, 17, 18, 20, 23, 24, 27], "union": [3, 7, 10, 20, 24], "int": [3, 4, 5, 6, 9, 10, 15, 16, 17, 18, 20, 24, 25], "order": [3, 6, 9, 17, 25], "search": [3, 4, 12], "convers": 3, "between": [3, 7, 16, 17, 24, 25], "epd": 3, "dp": [3, 9, 10, 12, 20, 21, 27], "target_epsilon": [4, 20], "target_delta": [4, 20], "epoch": [4, 6, 20, 25], "epsilon_toler": 4, "0": [4, 6, 7, 9, 10, 17, 20, 24, 25], "01": [4, 6, 17], "comput": [4, 8, 9, 10, 11, 12, 20, 21, 23], "level": [4, 8, 17], "sigma": [4, 20], "reach": 4, "total": [4, 25], "end": [4, 5, 9, 11, 20], "given": [4, 7, 8, 11, 17, 20, 22, 24, 25], "usual": [4, 20], "batch_siz": [4, 5, 7, 10, 11, 15, 16, 17, 18, 20, 23], "n_data": 4, "number": [4, 6, 7, 16, 17, 20, 24, 25], "run": [4, 8, 9, 10, 11, 20, 27], "estim": [4, 6], "precis": 4, "binari": 4, "The": [4, 6, 9, 10, 11, 16, 17, 20, 22, 24, 25, 27], "ensur": [4, 20, 25], "batch_memory_manag": 5, "batchmemorymanag": [5, 12, 17], "data_load": [5, 7, 20], "max_physical_batch_s": 5, "context": 5, "consumpt": 5, "dure": [5, 11, 20, 24], "train": [5, 6, 10, 20, 27], "allow": [5, 9], "set": [5, 7, 9, 11, 17, 20, 24, 25], "hard": 5, "limit": [5, 10, 17], "physic": 5, "size": [5, 6, 7, 9, 10, 15, 16, 17, 18, 23, 24, 25], "just": [5, 17, 20, 22], "line": [5, 6], "code": [5, 6], "chang": [5, 20], "both": [5, 8, 9, 10, 24], "simul": [5, 17], "larg": [5, 17], "logic": [5, 27], "safeguard": 5, "against": 5, "occasion": 5, "produc": [5, 7], "uniformwithreplacementsampl": [5, 7, 25, 26], "note": [5, 10, 11, 17, 20], "doesn": [5, 10, 11, 20, 22], "t": [5, 7, 10, 11, 15, 16, 17, 18, 20, 22], "modifi": [5, 15, 17, 20], "dataload": [5, 7, 20], "you": [5, 6, 7, 11, 20, 27], "d": [5, 10, 24], "need": [5, 7, 8, 9, 10, 11], "new": [5, 7, 20], "batchsplittingsampl": [5, 12], "split": [5, 25], "smaller": 5, "sub": 5, "certain": [5, 7, 20], "maximum": [5, 20], "On": [5, 17], "everi": [5, 8, 9, 10, 11, 17, 20, 27], "check": [5, 11, 17, 20, 22, 27], "last": [5, 10, 17, 24], "compris": 5, "behaviour": [5, 7, 11, 17], "accordingli": 5, "onli": [5, 10, 11, 17, 24], "clip": [5, 15, 16, 17, 18, 20], "per": [5, 9, 10, 11, 16, 17, 18, 20], "gradient": [5, 8, 9, 11, 15, 16, 17, 18, 20, 22], "sum": [5, 11, 15, 16, 17, 18, 20, 24, 25], "them": [5, 7, 8, 9, 10, 11], "p": [5, 10, 11, 15, 16, 17, 18], "summed_grad": [5, 16, 17, 18], "zero_grad": [5, 17, 19], "clear": [5, 11, 17], "grad_sampl": [5, 10, 11, 17, 19], "leav": [5, 20], "grad": [5, 10, 11, 15, 16, 17, 18, 22], "behav": [5, 17, 20], "normal": [5, 17, 20], "exampl": [5, 6, 7, 9, 10, 17, 20, 24], "assum": [5, 17, 24], "ve": 5, "initi": [5, 8, 9, 10], "your": [5, 20, 27], "pass": [5, 7, 8, 9, 10, 11, 16, 17, 20, 27], "privacyengin": [5, 12, 20], "For": [5, 8, 9, 11, 17, 20, 24], "we": [5, 7, 11, 17, 20], "4": [5, 7, 9, 10, 17, 24], "model": [5, 6, 8, 10, 11, 15, 16, 17, 20, 22], "_init_private_train": 5, "criterion": 5, "nn": [5, 8, 9, 10, 11, 17, 22, 23, 24, 27], "crossentropyloss": 5, "2": [5, 6, 7, 10, 11, 17, 24], "new_data_load": 5, "data": [5, 8, 10, 11, 12, 15, 16, 20], "label": 5, "assert": 5, "len": 5, "more": [5, 11, 20, 22, 24], "than": [5, 6, 20], "output": [5, 7, 9, 10, 24, 25], "loss": [5, 6, 11, 15, 16, 17, 18, 20], "backward": [5, 10, 11, 16, 17], "won": [5, 17], "actual": [5, 15, 16, 17, 18], "make": [5, 11, 27], "unless": [5, 11, 15, 17], "over": [5, 6, 7, 8, 10, 11, 17, 20, 22, 24], "sampler": [5, 7, 11, 12, 26], "max_batch_s": [5, 10], "accord": [5, 25], "underli": [5, 16, 17], "instanc": [5, 7, 8, 9, 10, 11], "index": [5, 12], "sequenc": [5, 7, 9, 10, 12, 26], "chunk": [5, 25], "while": [5, 8, 9, 10, 11, 22], "coordin": 5, "when": [5, 6, 9, 10, 11, 15, 16, 17, 18, 20, 24, 25], "ha": [5, 9, 10, 11, 20], "wrap": [5, 7, 11, 15, 16, 17, 18, 20], "max": [5, 15, 16, 17, 18], "emit": 5, "indic": [5, 11, 15, 16, 17, 18, 20, 22, 25, 27], "notifi": 5, "wrap_data_load": [5, 12], "replac": [5, 10, 20], "batch_sampl": [5, 7], "loader": [5, 12, 20], "wrapper": [5, 17, 20, 22], "want": [5, 11, 20, 22, 27], "command": 6, "script": [6, 12], "appli": [6, 10, 17, 22, 25], "iter": [6, 10, 20, 22, 24, 25], "gaussian": [6, 17, 20, 25], "mainli": 6, "base": [6, 7, 8, 9, 10, 11, 20], "googl": 6, "tf": 6, "http": [6, 9, 10, 11, 22], "github": [6, 10, 11], "com": [6, 10, 11], "tensorflow": 6, "blob": 6, "master": 6, "tensorflow_privaci": 6, "analysi": 6, "compute_dp_sgd_privaci": [6, 21], "py": 6, "To": 6, "call": [6, 8, 9, 10, 11, 16, 17], "from": [6, 7, 9, 10, 11, 15, 16, 17, 18, 22, 24, 25], "enter": 6, "python": 6, "m": [6, 9, 11], "3": [6, 10, 17, 24], "1e": 6, "5": [6, 7, 10, 17, 24], "1": [6, 9, 10, 11, 16, 17, 20, 22, 24, 25], "10": 6, "20": [6, 9], "100": 6, "300": 6, "satisfi": 6, "differenti": [6, 20], "39": 6, "05": [6, 20], "verbos": 6, "perform": [6, 8, 9, 10, 11, 15, 16, 17, 18, 20], "find": 6, "probabl": [6, 7, 20, 25], "each": [6, 7, 10, 11, 17, 24, 25], "dataset": [6, 7, 20, 25], "select": [6, 7, 25], "next": [6, 7, 17, 25], "ratio": [6, 20], "standard": [6, 10, 20], "deviat": [6, 20], "l2": [6, 20], "sensit": [6, 20], "ad": [6, 9, 11, 17, 20, 24], "A": [6, 10, 15, 16, 17, 24], "enabl": [6, 7, 11, 20, 25], "print": [6, 10], "result": [6, 11, 15, 16, 17, 24], "tupl": [6, 7, 10, 11, 20, 22, 24], "pair": [6, 10], "greater": 6, "dpdataload": [7, 12], "collate_fn": 7, "drop_last": 7, "gener": [7, 15, 16, 17, 18, 20, 22, 24, 25], "distribut": [7, 12, 15, 16, 20, 25], "alwai": [7, 10, 11, 17, 22, 27], "doe": [7, 11, 17, 20], "support": [7, 9, 10, 11, 20, 22, 24], "empti": [7, 11, 17], "typic": [7, 16, 17], "instanti": 7, "from_data_load": 7, "method": [7, 11, 20, 24], "anoth": 7, "would": [7, 16, 17], "preserv": 7, "origin": [7, 9, 10, 20], "except": [7, 10, 11, 16, 17, 24, 27], "two": [7, 16, 17, 22], "aspect": 7, "first": [7, 11, 20, 24, 27], "switch": 7, "thu": 7, "e": [7, 9, 10, 11], "element": [7, 9, 10, 25], "defin": [7, 8, 9, 10, 11], "nb": 7, "lead": 7, "variabl": 7, "nb2": 7, "By": 7, "calcul": [7, 9, 11, 16, 17, 20, 24], "averag": [7, 8, 9, 11, 15, 16, 17, 18], "stai": 7, "same": [7, 9, 10, 11, 17, 20, 23, 24, 25, 27], "second": [7, 11], "collat": [7, 12], "most": [7, 15, 16, 17], "pytorch": [7, 9, 10, 11, 20, 22], "modul": [7, 8, 9, 10, 11, 12, 17, 20, 26, 27], "happili": 7, "process": [7, 11, 15, 16, 17, 24], "tensor": [7, 9, 10, 11, 12, 15, 17, 20, 23, 26], "shape": [7, 9, 10, 11, 17, 24], "n": [7, 9], "mani": [7, 10], "fail": 7, "As": [7, 11], "becom": 7, "possibl": [7, 11, 16, 17], "handl": 7, "see": [7, 9, 10, 11, 15, 16, 17, 18, 20, 22, 24], "torch": [7, 8, 9, 10, 11, 15, 16, 17, 18, 20, 22, 23, 24, 25], "includ": [7, 9, 22], "num_work": 7, "pin_memori": 7, "timeout": 7, "worker_init_fn": 7, "multiprocessing_context": 7, "random": [7, 15, 16, 17, 18, 20, 25], "prefetch_factor": 7, "persistent_work": 7, "ll": 7, "ddp": 7, "environ": 7, "distributeduniformwithreplacementsampl": [7, 25, 26], "implement": [7, 8, 9, 10, 11, 16, 18, 20, 22, 24], "argument": [7, 9, 10, 17, 20, 27], "must": [7, 10, 11], "iterabledataset": 7, "all": [7, 8, 9, 10, 11, 17, 20, 22, 24, 25, 27], "attribut": [7, 10, 11, 17], "inherit": 7, "x": [7, 9, 10, 24], "y": [7, 10], "randn": [7, 9], "64": 7, "randint": 7, "tensordataset": 7, "dp_data_load": 7, "sample_empty_shap": 7, "dtype": [7, 9], "length": [7, 9, 10, 23, 24, 25], "zero": [7, 10, 17, 24], "sinc": [7, 8, 9, 10, 11], "case": [7, 11, 27], "correct": 7, "albeit": 7, "dimens": [7, 9, 10, 11, 20, 24], "being": [7, 9, 10, 20, 24], "tensort": 7, "collam": 7, "dtype_saf": [7, 12], "safe": 7, "getter": 7, "exist": [7, 11, 22, 27], "shape_saf": [7, 12], "switch_gener": [7, 12], "exact": 7, "provid": [7, 9, 20], "enhanc": 7, "user": [7, 9], "cryptograph": [7, 20], "secur": [7, 20], "wrap_collate_with_empti": [7, 12], "equival": [7, 20, 24], "non": [7, 10, 11, 17, 20], "differentiallyprivatedistributeddataparallel": [8, 12], "parallel": [8, 16], "packag": 8, "intern": [8, 9, 10], "share": [8, 9, 10], "scriptmodul": [8, 9, 10], "forward": [8, 9, 10, 11, 13, 16, 17], "should": [8, 9, 10, 11, 15, 17, 20, 22], "overridden": [8, 9, 10, 11], "although": [8, 9, 10, 11], "recip": [8, 9, 10, 11], "within": [8, 9, 10, 11], "afterward": [8, 9, 10, 11], "instead": [8, 9, 10, 11, 17, 20], "former": [8, 9, 10, 11], "take": [8, 9, 10, 11, 15, 16, 17, 18, 20, 27], "care": [8, 9, 10, 11], "regist": [8, 9, 10, 11, 20, 27], "hook": [8, 9, 10, 11, 17, 20], "latter": [8, 9, 10, 11], "silent": [8, 9, 10, 11], "ignor": [8, 9, 10, 11, 15, 16, 17, 18, 24], "average_gradi": [8, 12], "worker": [8, 25], "layer": [9, 10, 11, 12, 16, 18, 20, 24], "dp_multihead_attent": 9, "sequencebia": [9, 13], "embed_dim": 9, "batch_first": [9, 10, 11, 20], "add": [9, 11, 15, 16, 17, 20], "bia": [9, 10, 13], "l": [9, 10, 24], "where": [9, 10, 11, 17, 24], "embed": 9, "have": [9, 11, 17, 22], "learnabl": 9, "16": 9, "21": 9, "num_head": 9, "dropout": [9, 10], "add_bias_kv": 9, "add_zero_attn": 9, "kdim": 9, "vdim": 9, "devic": 9, "friendli": [9, 10], "multiheadattent": 9, "full": [9, 10, 11, 20], "refer": [9, 10], "leverag": 9, "build": 9, "block": [9, 24], "engin": [9, 12], "contrast": 9, "queri": 9, "kei": 9, "valu": [9, 11, 15, 16, 17, 18, 20], "key_padding_mask": 9, "need_weight": 9, "attn_mask": 9, "is_caus": 9, "previous": 9, "save": [9, 11, 17, 20], "pleas": 9, "org": [9, 22], "tutori": 9, "what_is_state_dict": 9, "html": [9, 22], "prefix": 9, "keep_var": 9, "whole": 9, "persist": 9, "buffer": 9, "g": [9, 10, 11], "ar": [9, 11, 16, 17, 20, 22, 27], "correspond": [9, 10, 11, 17, 20], "shallow": 9, "copi": [9, 20, 22], "It": [9, 17, 23, 24, 27], "also": [9, 17, 20, 22, 27], "accept": 9, "posit": 9, "howev": [9, 11], "deprec": 9, "keyword": [9, 27], "enforc": 9, "futur": 9, "releas": 9, "avoid": 9, "design": 9, "updat": [9, 15, 17, 20], "compos": 9, "detach": 9, "autograd": [9, 11], "xdoctest": 9, "skip": [9, 17], "undefin": 9, "var": 9, "weight": [9, 17], "dp_rnn": 10, "dpgru": [10, 13], "input_s": 10, "hidden_s": 10, "num_lay": 10, "bidirect": 10, "proj_siz": 10, "multi": 10, "gate": 10, "recurr": [10, 11], "unit": 10, "gru": 10, "rnn": [10, 23], "drop": 10, "document": [10, 20], "descript": 10, "after": [10, 17, 20], "export": 10, "infer": [10, 15, 16, 17, 18], "dpgrucel": [10, 13], "cell": 10, "grucel": 10, "hx": 10, "batch_size_t": 10, "dplstm": [10, 13], "long": 10, "short": 10, "term": 10, "memori": [10, 12, 17], "lstm": 10, "dplstmcell": [10, 13], "lstmcell": 10, "nonlinear": 10, "tanh": 10, "elman": 10, "math": 10, "anh": 10, "ext": 10, "relu": 10, "linear": 10, "dprnnbase": [10, 13], "mode": [10, 20], "cell_param": 10, "like": [10, 17, 20, 24], "rnnbase": 10, "issu": [10, 11], "4930": 10, "issuecom": 10, "361851298": 10, "bi": 10, "direct": 10, "sequenti": 10, "dprnncellbas": [10, 13], "cudnn": 10, "state_init": 10, "singl": [10, 15, 17, 24], "here": [10, 22], "equal": [10, 25], "hidden": 10, "packedsequ": [10, 23], "h_0": 10, "c_0": 10, "b": [10, 24], "h": [10, 24], "addit": [10, 17, 20], "h_n": 10, "c_n": 10, "featur": 10, "h_t": 10, "final": 10, "num_direct": 10, "els": 10, "forward_lay": [10, 13], "seq_length": 10, "is_pack": 10, "reverse_lay": 10, "c_t": 10, "h_last": 10, "c_last": 10, "timestep": 10, "store": [10, 11, 15, 16, 17, 18, 23], "network": 10, "dprnncell": [10, 13], "whether": [10, 11, 25, 27], "revers": 10, "iterate_lay": [10, 13], "through": 10, "self": [10, 17], "dir": 10, "hi": 10, "rnncell": 10, "num_chunk": 10, "rnnlinear": [10, 13], "in_featur": 10, "out_featur": 10, "transform": 10, "incom": 10, "xa": 10, "get": 10, "accumul": [10, 11, 16, 17], "concaten": 10, "max_batch_len": [10, 11], "determin": [10, 20], "apply_permut": [10, 13], "dim": [10, 11, 24], "permut": 10, "along": 10, "do": [10, 11, 17], "noth": [10, 11, 17], "grad_sample_modul": 11, "loss_reduct": [11, 15, 16, 17, 18, 20], "mean": [11, 15, 16, 17, 18, 20], "strict": [11, 27], "force_functorch": 11, "abstractgradsamplemodul": [11, 20], "custom": [11, 27], "written": 11, "readm": 11, "md": 11, "detail": [11, 15, 16, 17, 18, 20, 22, 24], "flag": [11, 17, 20, 22, 24, 25, 27], "repres": [11, 20, 23], "k": [11, 20], "reduct": [11, 15, 16, 17, 18, 20], "aggreg": [11, 15, 16, 17, 18, 20, 24], "oper": [11, 15, 16, 17, 18, 20], "submodul": [11, 20, 22], "know": 11, "how": [11, 20], "best": 11, "effort": 11, "basi": 11, "thei": [11, 17, 22], "avail": 11, "recommend": 11, "becaus": [11, 17], "some": [11, 17, 20], "unsupport": 11, "batchnorm": 11, "affect": [11, 17], "other": [11, 16, 17, 20], "concept": 11, "entir": [11, 20], "functorch": 11, "without": [11, 17], "notimplementederror": 11, "its": [11, 25], "add_hook": 11, "activ": 11, "backprop": 11, "remove_hook": 11, "disabl": 11, "allow_grad_accumul": 11, "unset": 11, "detect": 11, "multipl": 11, "out": [11, 17], "throw": [11, 22], "capture_backprops_hook": 11, "_forward_input": 11, "forward_output": 11, "associ": [11, 17], "field": [11, 15, 17], "straightforward": 11, "exactli": 11, "complic": 11, "time": [11, 27], "still": 11, "reason": 11, "_current_grad_sampl": 11, "could": 11, "either": 11, "disable_hook": 11, "global": 11, "instal": [11, 20], "librari": 11, "why": 11, "25723": 11, "bug": 11, "remov": [11, 22, 24], "graph": 11, "alreadi": [11, 20], "construct": [11, 20], "least": 11, "turn": 11, "off": 11, "enable_hook": 11, "opposit": 11, "explicitli": 11, "don": 11, "re": 11, "forbid_grad_accumul": 11, "is_support": 11, "individu": [11, 20], "found": [11, 20], "rearrange_grad_sampl": 11, "rearrang": 11, "captur": 11, "depend": [11, 27], "fulli": 11, "raise_if_error": 11, "neg": 11, "Will": 11, "success": 11, "error": [11, 20, 22, 27], "create_or_accumulate_grad_sampl": [11, 12], "extra": [11, 24], "belong": [11, 17], "gradsamplemodul": [12, 17, 20], "dpperlayeroptim": [12, 19], "distributeddpoptim": [12, 19], "distributedperlayeroptim": [12, 19], "modulevalid": [12, 20], "register_module_fix": [12, 27], "register_module_valid": [12, 27], "schedul": 12, "manag": [12, 17], "dpmultiheadattent": [12, 13], "dprnn": [12, 13], "pack": [12, 26], "uniform": [12, 26], "sgd": [12, 17, 20, 21], "page": 12, "ddpoptim": 15, "max_grad_norm": [15, 16, 17, 18, 20], "expected_batch_s": [15, 16, 17, 18], "secure_mod": [15, 16, 17, 18, 20], "compat": [15, 16, 20, 27], "norm": [15, 16, 17, 18, 20, 24], "denomin": [15, 16, 17, 18], "requir": [15, 16, 17, 18, 20, 22, 27], "approach": [15, 16, 17, 18], "robust": [15, 16, 17, 18], "point": [15, 16, 17, 18, 20, 24], "arithmet": [15, 16, 17, 18, 20], "attack": [15, 16, 17, 18, 20], "_generate_nois": [15, 16, 17, 18, 20], "add_nois": [15, 16, 17, 19], "closur": [15, 16, 17], "reevalu": [15, 16, 17], "specifi": [15, 17, 22], "ddp_perlayeroptim": 16, "strategi": [16, 18], "properti": [16, 17], "accumulated_iter": [16, 17, 19], "yet": [16, 17], "In": [16, 17, 25], "word": [16, 17], "track": [16, 17], "done": [16, 17], "real": [16, 17], "clip_and_accumul": [16, 17, 18, 19], "pre_step": [16, 17, 19], "action": [16, 17, 24], "befor": [16, 17], "simpledistributedperlayeroptim": [16, 19], "dpoptimz": 17, "therefor": 17, "high": 17, "look": [17, 27], "abov": 17, "threshold": 17, "calibr": 17, "std": 17, "mycustommodel": [17, 20, 27], "lr": [17, 20], "dp_optim": 17, "attach_step_hook": [17, 19], "fn": 17, "execut": 17, "commonli": 17, "signatur": [17, 27], "foo": 17, "flat": [17, 20, 24], "scale_grad": [17, 19], "divid": [17, 25], "signal_skip_step": [17, 19], "do_skip": 17, "queue": 17, "latest": 17, "proce": 17, "touch": 17, "virtual": 17, "footprint": 17, "entri": [17, 20], "hold": [17, 27], "Its": 17, "content": 17, "differ": [17, 25], "common": 17, "characterist": 17, "itself": 17, "NOT": 17, "id": 17, "param_group": 17, "group": 17, "metadata": 17, "learn": 17, "decai": 17, "well": 17, "mai": [17, 27], "zip": 17, "match": 17, "verif": 17, "might": 17, "someth": 17, "momentum_buff": 17, "weight_decai": 17, "001": 17, "set_to_non": 17, "never": 17, "regular": 17, "perlayeroptim": 18, "privacy_engin": 20, "prv": 20, "main": 20, "api": 20, "encapsul": [20, 27], "been": 20, "expos": 20, "make_priv": 20, "privat": 20, "counterpart": 20, "demo_dataload": 20, "continu": 20, "prvaccount": 20, "strong": 20, "guarante": 20, "shuffl": [20, 25], "oppos": [20, 22], "pseudo": 20, "rng": 20, "vanilla": 20, "prevent": 20, "torchcsprng": 20, "get_compatible_modul": 20, "fix": [20, 27], "deep": 20, "close": 20, "spent": 20, "is_compat": 20, "task": 20, "compon": 20, "poisson_sampl": 20, "noise_gener": 20, "grad_sample_mod": 20, "relat": 20, "respons": 20, "act": 20, "now": 20, "much": 20, "higher": 20, "unchang": 20, "technic": 20, "fit": 20, "assumpt": 20, "made": [20, 27], "good": 20, "approxim": 20, "unfeas": 20, "per_lay": 20, "adapt": 20, "prefer": 20, "combin": 20, "notabl": 20, "gain": 20, "around": 20, "brand": 20, "possibli": 20, "make_private_with_epsilon": 20, "version": 20, "achiev": 20, "metric": 20, "inform": 20, "leak": 20, "intend": 20, "reli": 20, "appropri": 20, "save_checkpoint": 20, "path": 20, "noise_schedul": 20, "grad_clip_schedul": 20, "checkpoint_dict": 20, "module_state_dict_kwarg": 20, "torch_save_kwarg": 20, "pathlik": 20, "binaryio": 20, "io": 20, "byte": 20, "_noiseschedul": 20, "whose": [20, 22], "_gradclipschedul": 20, "fill": 20, "checkpoint": 20, "unsupportedmoduleerror": [20, 27], "incompat": 20, "module_util": 22, "are_state_dict_equ": [22, 26], "sd1": 22, "sd2": 22, "compar": 22, "log": 22, "discrep": 22, "clone_modul": [22, 26], "handi": 22, "clone": 22, "deepcopi": 22, "easier": 22, "serial": 22, "bytesio": 22, "read": 22, "get_submodul": [22, 26], "pasta": 22, "9": 22, "8": 22, "favour": 22, "onc": 22, "abandon": 22, "doc": 22, "stabl": 22, "highlight": 22, "string": [22, 24], "attributeerror": 22, "parametrized_modul": [22, 26], "recurs": 22, "those": 22, "organ": 22, "requires_grad": [22, 26], "examin": 22, "trainable_modul": [22, 26], "trainabl": 22, "ie": 22, "trainable_paramet": [22, 26], "packed_sequ": 23, "compute_seq_length": [23, 26], "packed_padded_sequ": 23, "running_seq_length": 23, "stat": 24, "tensor_util": 24, "calc_sample_norm": [24, 26], "named_param": 24, "overal": 24, "0th": 24, "t1": 24, "rand": 24, "t2": 24, "calc_sample_norms_one_lay": [24, 26], "filter_dilated_row": [24, 26], "dilat": 24, "dilated_kernel_s": 24, "kernel_s": 24, "helper": 24, "row": 24, "slice": 24, "unfold": 24, "unfold3d": [24, 26], "c": 24, "d_out": 24, "h_out": 24, "w_out": 24, "kernel": 24, "definit": 24, "sum_over_all_but_batch_and_last_n": [24, 26], "n_dim": 24, "exclud": 24, "keep": 24, "ones": 24, "unfold2d": [24, 26], "pad": 24, "stride": 24, "extract": 24, "slide": 24, "local": [24, 25], "4d": 24, "imag": 24, "5d": 24, "w": 24, "implicit": 24, "side": 24, "spatial": 24, "space": 24, "np": 24, "product": 24, "6": 24, "7": 24, "arang": 24, "view": 24, "32": 24, "120": 24, "uniform_sampl": 25, "total_s": 25, "shuffle_se": 25, "follow": 25, "among": 25, "replica": 25, "plu": 25, "minu": 25, "independ": 25, "form": 25, "particular": 25, "num_replica": 25, "draw": 25, "seed": 25, "across": 25, "item": 25, "round": 25, "set_epoch": [25, 26], "yield": 25, "num_sampl": 25, "module_valid": 27, "work": 27, "namespac": 27, "fixer": 27, "sub_modul": 27, "root": 27, "arbitrari": 27, "fix_and_valid": 27, "failur": 27, "is_valid": 27, "boolean": 27, "target_class_or_class": 27, "validator_class": 27, "decor": 27, "invok": 27, "incompatobl": 27, "own": 27, "registri": 27, "def": 27, "help": 27, "insid": 27, "under": 27, "unsupportederror": 27}, "objects": {"opacus.accountants": [[2, 0, 0, "-", "accountant"], [1, 0, 0, "-", "gdp"], [3, 0, 0, "-", "rdp"], [4, 0, 0, "-", "utils"]], "opacus.accountants.accountant": [[2, 1, 1, "", "IAccountant"]], "opacus.accountants.accountant.IAccountant": [[2, 2, 1, "", "get_epsilon"], [2, 2, 1, "", "get_optimizer_hook_fn"], [2, 2, 1, "", "load_state_dict"], [2, 2, 1, "", "mechanism"], [2, 2, 1, "", "state_dict"], [2, 2, 1, "", "step"]], "opacus.accountants.gdp": [[1, 1, 1, "", "GaussianAccountant"]], "opacus.accountants.gdp.GaussianAccountant": [[1, 2, 1, "", "get_epsilon"], [1, 2, 1, "", "mechanism"], [1, 2, 1, "", "step"]], "opacus.accountants.rdp": [[3, 1, 1, "", "RDPAccountant"]], "opacus.accountants.rdp.RDPAccountant": [[3, 2, 1, "", "get_epsilon"], [3, 2, 1, "", "mechanism"], [3, 2, 1, "", "step"]], "opacus.accountants.utils": [[4, 3, 1, "", "get_noise_multiplier"]], "opacus": [[7, 0, 0, "-", "data_loader"], [8, 0, 0, "-", "distributed"], [20, 0, 0, "-", "privacy_engine"]], "opacus.data_loader": [[7, 1, 1, "", "DPDataLoader"], [7, 3, 1, "", "collate"], [7, 3, 1, "", "dtype_safe"], [7, 3, 1, "", "shape_safe"], [7, 3, 1, "", "switch_generator"], [7, 3, 1, "", "wrap_collate_with_empty"]], "opacus.data_loader.DPDataLoader": [[7, 2, 1, "", "from_data_loader"]], "opacus.distributed": [[8, 1, 1, "", "DifferentiallyPrivateDistributedDataParallel"], [8, 3, 1, "", "average_gradients"]], "opacus.distributed.DifferentiallyPrivateDistributedDataParallel": [[8, 2, 1, "", "forward"]], "opacus.grad_sample": [[11, 0, 0, "-", "grad_sample_module"]], "opacus.grad_sample.grad_sample_module": [[11, 1, 1, "", "GradSampleModule"], [11, 3, 1, "", "create_or_accumulate_grad_sample"]], "opacus.grad_sample.grad_sample_module.GradSampleModule": [[11, 2, 1, "", "add_hooks"], [11, 2, 1, "", "allow_grad_accumulation"], [11, 2, 1, "", "capture_backprops_hook"], [11, 2, 1, "", "disable_hooks"], [11, 2, 1, "", "enable_hooks"], [11, 2, 1, "", "forbid_grad_accumulation"], [11, 2, 1, "", "forward"], [11, 2, 1, "", "is_supported"], [11, 2, 1, "", "rearrange_grad_samples"], [11, 2, 1, "", "remove_hooks"], [11, 2, 1, "", "validate"]], "opacus.layers": [[9, 0, 0, "-", "dp_multihead_attention"], [10, 0, 0, "-", "dp_rnn"]], "opacus.layers.dp_multihead_attention": [[9, 1, 1, "", "DPMultiheadAttention"], [9, 1, 1, "", "SequenceBias"]], "opacus.layers.dp_multihead_attention.DPMultiheadAttention": [[9, 2, 1, "", "forward"], [9, 2, 1, "", "load_state_dict"], [9, 2, 1, "", "state_dict"]], "opacus.layers.dp_multihead_attention.SequenceBias": [[9, 4, 1, "", "bias"], [9, 2, 1, "", "forward"]], "opacus.layers.dp_rnn": [[10, 1, 1, "", "DPGRU"], [10, 1, 1, "", "DPGRUCell"], [10, 1, 1, "", "DPLSTM"], [10, 1, 1, "", "DPLSTMCell"], [10, 1, 1, "", "DPRNN"], [10, 1, 1, "", "DPRNNBase"], [10, 1, 1, "", "DPRNNCell"], [10, 1, 1, "", "DPRNNCellBase"], [10, 1, 1, "", "RNNLinear"], [10, 3, 1, "", "apply_permutation"]], "opacus.layers.dp_rnn.DPGRUCell": [[10, 2, 1, "", "forward"]], "opacus.layers.dp_rnn.DPLSTMCell": [[10, 2, 1, "", "forward"]], "opacus.layers.dp_rnn.DPRNNBase": [[10, 2, 1, "", "forward"], [10, 2, 1, "", "forward_layer"], [10, 2, 1, "", "iterate_layers"]], "opacus.layers.dp_rnn.DPRNNCell": [[10, 2, 1, "", "forward"]], "opacus.optimizers": [[16, 0, 0, "-", "ddp_perlayeroptimizer"], [15, 0, 0, "-", "ddpoptimizer"], [17, 0, 0, "-", "optimizer"], [18, 0, 0, "-", "perlayeroptimizer"]], "opacus.optimizers.ddp_perlayeroptimizer": [[16, 1, 1, "", "DistributedPerLayerOptimizer"], [16, 1, 1, "", "SimpleDistributedPerLayerOptimizer"]], "opacus.optimizers.ddp_perlayeroptimizer.DistributedPerLayerOptimizer": [[16, 5, 1, "", "accumulated_iterations"], [16, 2, 1, "", "add_noise"], [16, 2, 1, "", "clip_and_accumulate"], [16, 2, 1, "", "pre_step"]], "opacus.optimizers.ddpoptimizer": [[15, 1, 1, "", "DistributedDPOptimizer"]], "opacus.optimizers.ddpoptimizer.DistributedDPOptimizer": [[15, 2, 1, "", "add_noise"], [15, 2, 1, "", "step"]], "opacus.optimizers.optimizer": [[17, 1, 1, "", "DPOptimizer"]], "opacus.optimizers.optimizer.DPOptimizer": [[17, 5, 1, "", "accumulated_iterations"], [17, 2, 1, "", "add_noise"], [17, 2, 1, "", "attach_step_hook"], [17, 2, 1, "", "clip_and_accumulate"], [17, 5, 1, "", "grad_samples"], [17, 2, 1, "", "load_state_dict"], [17, 5, 1, "", "params"], [17, 2, 1, "", "pre_step"], [17, 2, 1, "", "scale_grad"], [17, 2, 1, "", "signal_skip_step"], [17, 2, 1, "", "state_dict"], [17, 2, 1, "", "step"], [17, 2, 1, "", "zero_grad"]], "opacus.optimizers.perlayeroptimizer": [[18, 1, 1, "", "DPPerLayerOptimizer"]], "opacus.optimizers.perlayeroptimizer.DPPerLayerOptimizer": [[18, 2, 1, "", "clip_and_accumulate"]], "opacus.privacy_engine": [[20, 1, 1, "", "PrivacyEngine"]], "opacus.privacy_engine.PrivacyEngine": [[20, 2, 1, "", "get_compatible_module"], [20, 2, 1, "", "get_epsilon"], [20, 2, 1, "", "is_compatible"], [20, 2, 1, "", "make_private"], [20, 2, 1, "", "make_private_with_epsilon"], [20, 2, 1, "", "save_checkpoint"], [20, 2, 1, "", "validate"]], "opacus.scripts": [[6, 0, 0, "-", "compute_dp_sgd_privacy"]], "opacus.scripts.compute_dp_sgd_privacy": [[6, 3, 1, "", "compute_dp_sgd_privacy"]], "opacus.utils": [[5, 0, 0, "-", "batch_memory_manager"], [22, 0, 0, "-", "module_utils"], [23, 0, 0, "-", "packed_sequences"], [24, 0, 0, "-", "tensor_utils"], [25, 0, 0, "-", "uniform_sampler"]], "opacus.utils.batch_memory_manager": [[5, 1, 1, "", "BatchMemoryManager"], [5, 1, 1, "", "BatchSplittingSampler"], [5, 3, 1, "", "wrap_data_loader"]], "opacus.utils.module_utils": [[22, 3, 1, "", "are_state_dict_equal"], [22, 3, 1, "", "clone_module"], [22, 3, 1, "", "get_submodule"], [22, 3, 1, "", "parametrized_modules"], [22, 3, 1, "", "requires_grad"], [22, 3, 1, "", "trainable_modules"], [22, 3, 1, "", "trainable_parameters"]], "opacus.utils.packed_sequences": [[23, 3, 1, "", "compute_seq_lengths"]], "opacus.utils.tensor_utils": [[24, 3, 1, "", "calc_sample_norms"], [24, 3, 1, "", "calc_sample_norms_one_layer"], [24, 3, 1, "", "filter_dilated_rows"], [24, 3, 1, "", "sum_over_all_but_batch_and_last_n"], [24, 3, 1, "", "unfold2d"], [24, 3, 1, "", "unfold3d"]], "opacus.utils.uniform_sampler": [[25, 1, 1, "", "DistributedUniformWithReplacementSampler"], [25, 1, 1, "", "UniformWithReplacementSampler"]], "opacus.utils.uniform_sampler.DistributedUniformWithReplacementSampler": [[25, 2, 1, "", "set_epoch"]], "opacus.validators": [[27, 0, 0, "-", "module_validator"], [27, 0, 0, "-", "utils"]], "opacus.validators.module_validator": [[27, 1, 1, "", "ModuleValidator"]], "opacus.validators.module_validator.ModuleValidator": [[27, 2, 1, "", "fix"], [27, 2, 1, "", "fix_and_validate"], [27, 2, 1, "", "is_valid"], [27, 2, 1, "", "validate"]], "opacus.validators.utils": [[27, 3, 1, "", "register_module_fixer"], [27, 3, 1, "", "register_module_validator"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:function", "4": "py:attribute", "5": "py:property"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "function", "Python function"], "4": ["py", "attribute", "Python attribute"], "5": ["py", "property", "Python property"]}, "titleterms": {"privaci": [0, 6, 20], "account": 0, "gaussianaccount": 1, "iaccount": 2, "rdpaccount": 3, "util": [4, 22, 24, 26], "batch": 5, "memori": 5, "manag": 5, "comput": 6, "dp": [6, 7, 13], "sgd": 6, "data": 7, "loader": 7, "distribut": 8, "dpmultiheadattent": 9, "dprnn": 10, "gradsamplemodul": 11, "opacu": 12, "api": 12, "refer": 12, "indic": 12, "tabl": 12, "layer": 13, "nois": 14, "schedul": 14, "distributeddpoptim": 15, "distributedperlayeroptim": 16, "dpoptim": 17, "dpperlayeroptim": 18, "optim": 19, "engin": 20, "script": 21, "modul": 22, "pack": 23, "sequenc": 23, "tensor": 24, "uniform": 25, "sampler": 25, "modulevalid": 27}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.todo": 2, "sphinx.ext.viewcode": 1, "sphinx.ext.intersphinx": 1, "sphinx": 60}, "alltitles": {"Privacy Accounting": [[0, "privacy-accounting"]], "GaussianAccountant": [[1, "module-opacus.accountants.gdp"]], "IAccountant": [[2, "module-opacus.accountants.accountant"]], "RDPAccountant": [[3, "module-opacus.accountants.rdp"]], "Utils": [[4, "module-opacus.accountants.utils"], [26, "utils"]], "Batch Memory Manager": [[5, "batch-memory-manager"]], "Compute DP-SGD Privacy": [[6, "module-opacus.scripts.compute_dp_sgd_privacy"]], "DP Data Loader": [[7, "module-opacus.data_loader"]], "Distributed": [[8, "module-opacus.distributed"]], "DPMultiheadAttention": [[9, "module-opacus.layers.dp_multihead_attention"]], "DPRNN": [[10, "module-opacus.layers.dp_rnn"]], "GradSampleModule": [[11, "module-opacus.grad_sample.grad_sample_module"]], "Opacus API Reference": [[12, "opacus-api-reference"]], "API Reference": [[12, null]], "Indices and Tables": [[12, "indices-and-tables"]], "DP Layers": [[13, "dp-layers"]], "Noise Scheduler": [[14, "noise-scheduler"]], "DistributedDPOptimizer": [[15, "module-opacus.optimizers.ddpoptimizer"]], "DistributedPerLayerOptimizer": [[16, "module-opacus.optimizers.ddp_perlayeroptimizer"]], "DPOptimizer": [[17, "module-opacus.optimizers.optimizer"]], "DPPerLayerOptimizer": [[18, "module-opacus.optimizers.perlayeroptimizer"]], "Optimizers": [[19, "optimizers"]], "Privacy Engine": [[20, "module-opacus.privacy_engine"]], "Scripts": [[21, "scripts"]], "Module Utils": [[22, "module-opacus.utils.module_utils"]], "Packed Sequences": [[23, "module-opacus.utils.packed_sequences"]], "Tensor Utils": [[24, "module-opacus.utils.tensor_utils"]], "Uniform Sampler": [[25, "module-opacus.utils.uniform_sampler"]], "ModuleValidator": [[27, "module-opacus.validators.module_validator"]]}, "indexentries": {"gaussianaccountant (class in opacus.accountants.gdp)": [[1, "opacus.accountants.gdp.GaussianAccountant"]], "get_epsilon() (opacus.accountants.gdp.gaussianaccountant method)": [[1, "opacus.accountants.gdp.GaussianAccountant.get_epsilon"]], "mechanism() (opacus.accountants.gdp.gaussianaccountant class method)": [[1, "opacus.accountants.gdp.GaussianAccountant.mechanism"]], "module": [[1, "module-opacus.accountants.gdp"], [2, "module-opacus.accountants.accountant"], [3, "module-opacus.accountants.rdp"], [4, "module-opacus.accountants.utils"], [5, "module-opacus.utils.batch_memory_manager"], [6, "module-opacus.scripts.compute_dp_sgd_privacy"], [7, "module-opacus.data_loader"], [8, "module-opacus.distributed"], [9, "module-opacus.layers.dp_multihead_attention"], [10, "module-opacus.layers.dp_rnn"], [11, "module-opacus.grad_sample.grad_sample_module"], [15, "module-opacus.optimizers.ddpoptimizer"], [16, "module-opacus.optimizers.ddp_perlayeroptimizer"], [17, "module-opacus.optimizers.optimizer"], [18, "module-opacus.optimizers.perlayeroptimizer"], [20, "module-opacus.privacy_engine"], [22, "module-opacus.utils.module_utils"], [23, "module-opacus.utils.packed_sequences"], [24, "module-opacus.utils.tensor_utils"], [25, "module-opacus.utils.uniform_sampler"], [27, "module-opacus.validators.module_validator"], [27, "module-opacus.validators.utils"]], "opacus.accountants.gdp": [[1, "module-opacus.accountants.gdp"]], "step() (opacus.accountants.gdp.gaussianaccountant method)": [[1, "opacus.accountants.gdp.GaussianAccountant.step"]], "iaccountant (class in opacus.accountants.accountant)": [[2, "opacus.accountants.accountant.IAccountant"]], "get_epsilon() (opacus.accountants.accountant.iaccountant method)": [[2, "opacus.accountants.accountant.IAccountant.get_epsilon"]], "get_optimizer_hook_fn() (opacus.accountants.accountant.iaccountant method)": [[2, "opacus.accountants.accountant.IAccountant.get_optimizer_hook_fn"]], "load_state_dict() (opacus.accountants.accountant.iaccountant method)": [[2, "opacus.accountants.accountant.IAccountant.load_state_dict"]], "mechanism() (opacus.accountants.accountant.iaccountant class method)": [[2, "opacus.accountants.accountant.IAccountant.mechanism"]], "opacus.accountants.accountant": [[2, "module-opacus.accountants.accountant"]], "state_dict() (opacus.accountants.accountant.iaccountant method)": [[2, "opacus.accountants.accountant.IAccountant.state_dict"]], "step() (opacus.accountants.accountant.iaccountant method)": [[2, "opacus.accountants.accountant.IAccountant.step"]], "rdpaccountant (class in opacus.accountants.rdp)": [[3, "opacus.accountants.rdp.RDPAccountant"]], "get_epsilon() (opacus.accountants.rdp.rdpaccountant method)": [[3, "opacus.accountants.rdp.RDPAccountant.get_epsilon"]], "mechanism() (opacus.accountants.rdp.rdpaccountant class method)": [[3, "opacus.accountants.rdp.RDPAccountant.mechanism"]], "opacus.accountants.rdp": [[3, "module-opacus.accountants.rdp"]], "step() (opacus.accountants.rdp.rdpaccountant method)": [[3, "opacus.accountants.rdp.RDPAccountant.step"]], "get_noise_multiplier() (in module opacus.accountants.utils)": [[4, "opacus.accountants.utils.get_noise_multiplier"]], "opacus.accountants.utils": [[4, "module-opacus.accountants.utils"]], "batchmemorymanager (class in opacus.utils.batch_memory_manager)": [[5, "opacus.utils.batch_memory_manager.BatchMemoryManager"]], "batchsplittingsampler (class in opacus.utils.batch_memory_manager)": [[5, "opacus.utils.batch_memory_manager.BatchSplittingSampler"]], "opacus.utils.batch_memory_manager": [[5, "module-opacus.utils.batch_memory_manager"]], "wrap_data_loader() (in module opacus.utils.batch_memory_manager)": [[5, "opacus.utils.batch_memory_manager.wrap_data_loader"]], "compute_dp_sgd_privacy() (in module opacus.scripts.compute_dp_sgd_privacy)": [[6, "opacus.scripts.compute_dp_sgd_privacy.compute_dp_sgd_privacy"]], "opacus.scripts.compute_dp_sgd_privacy": [[6, "module-opacus.scripts.compute_dp_sgd_privacy"]], "dpdataloader (class in opacus.data_loader)": [[7, "opacus.data_loader.DPDataLoader"]], "collate() (in module opacus.data_loader)": [[7, "opacus.data_loader.collate"]], "dtype_safe() (in module opacus.data_loader)": [[7, "opacus.data_loader.dtype_safe"]], "from_data_loader() (opacus.data_loader.dpdataloader class method)": [[7, "opacus.data_loader.DPDataLoader.from_data_loader"]], "opacus.data_loader": [[7, "module-opacus.data_loader"]], "shape_safe() (in module opacus.data_loader)": [[7, "opacus.data_loader.shape_safe"]], "switch_generator() (in module opacus.data_loader)": [[7, "opacus.data_loader.switch_generator"]], "wrap_collate_with_empty() (in module opacus.data_loader)": [[7, "opacus.data_loader.wrap_collate_with_empty"]], "differentiallyprivatedistributeddataparallel (class in opacus.distributed)": [[8, "opacus.distributed.DifferentiallyPrivateDistributedDataParallel"]], "average_gradients() (in module opacus.distributed)": [[8, "opacus.distributed.average_gradients"]], "forward() (opacus.distributed.differentiallyprivatedistributeddataparallel method)": [[8, "opacus.distributed.DifferentiallyPrivateDistributedDataParallel.forward"]], "opacus.distributed": [[8, "module-opacus.distributed"]], "dpmultiheadattention (class in opacus.layers.dp_multihead_attention)": [[9, "opacus.layers.dp_multihead_attention.DPMultiheadAttention"]], "sequencebias (class in opacus.layers.dp_multihead_attention)": [[9, "opacus.layers.dp_multihead_attention.SequenceBias"]], "bias (opacus.layers.dp_multihead_attention.sequencebias attribute)": [[9, "opacus.layers.dp_multihead_attention.SequenceBias.bias"]], "forward() (opacus.layers.dp_multihead_attention.dpmultiheadattention method)": [[9, "opacus.layers.dp_multihead_attention.DPMultiheadAttention.forward"]], "forward() (opacus.layers.dp_multihead_attention.sequencebias method)": [[9, "opacus.layers.dp_multihead_attention.SequenceBias.forward"]], "load_state_dict() (opacus.layers.dp_multihead_attention.dpmultiheadattention method)": [[9, "opacus.layers.dp_multihead_attention.DPMultiheadAttention.load_state_dict"]], "opacus.layers.dp_multihead_attention": [[9, "module-opacus.layers.dp_multihead_attention"]], "state_dict() (opacus.layers.dp_multihead_attention.dpmultiheadattention method)": [[9, "opacus.layers.dp_multihead_attention.DPMultiheadAttention.state_dict"]], "dpgru (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPGRU"]], "dpgrucell (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPGRUCell"]], "dplstm (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPLSTM"]], "dplstmcell (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPLSTMCell"]], "dprnn (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPRNN"]], "dprnnbase (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPRNNBase"]], "dprnncell (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPRNNCell"]], "dprnncellbase (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.DPRNNCellBase"]], "rnnlinear (class in opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.RNNLinear"]], "apply_permutation() (in module opacus.layers.dp_rnn)": [[10, "opacus.layers.dp_rnn.apply_permutation"]], "forward() (opacus.layers.dp_rnn.dpgrucell method)": [[10, "opacus.layers.dp_rnn.DPGRUCell.forward"]], "forward() (opacus.layers.dp_rnn.dplstmcell method)": [[10, "opacus.layers.dp_rnn.DPLSTMCell.forward"]], "forward() (opacus.layers.dp_rnn.dprnnbase method)": [[10, "opacus.layers.dp_rnn.DPRNNBase.forward"]], "forward() (opacus.layers.dp_rnn.dprnncell method)": [[10, "opacus.layers.dp_rnn.DPRNNCell.forward"]], "forward_layer() (opacus.layers.dp_rnn.dprnnbase method)": [[10, "opacus.layers.dp_rnn.DPRNNBase.forward_layer"]], "iterate_layers() (opacus.layers.dp_rnn.dprnnbase method)": [[10, "opacus.layers.dp_rnn.DPRNNBase.iterate_layers"]], "opacus.layers.dp_rnn": [[10, "module-opacus.layers.dp_rnn"]], "gradsamplemodule (class in opacus.grad_sample.grad_sample_module)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule"]], "add_hooks() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.add_hooks"]], "allow_grad_accumulation() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.allow_grad_accumulation"]], "capture_backprops_hook() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.capture_backprops_hook"]], "create_or_accumulate_grad_sample() (in module opacus.grad_sample.grad_sample_module)": [[11, "opacus.grad_sample.grad_sample_module.create_or_accumulate_grad_sample"]], "disable_hooks() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.disable_hooks"]], "enable_hooks() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.enable_hooks"]], "forbid_grad_accumulation() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.forbid_grad_accumulation"]], "forward() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.forward"]], "is_supported() (opacus.grad_sample.grad_sample_module.gradsamplemodule class method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.is_supported"]], "opacus.grad_sample.grad_sample_module": [[11, "module-opacus.grad_sample.grad_sample_module"]], "rearrange_grad_samples() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.rearrange_grad_samples"]], "remove_hooks() (opacus.grad_sample.grad_sample_module.gradsamplemodule method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.remove_hooks"]], "validate() (opacus.grad_sample.grad_sample_module.gradsamplemodule class method)": [[11, "opacus.grad_sample.grad_sample_module.GradSampleModule.validate"]], "distributeddpoptimizer (class in opacus.optimizers.ddpoptimizer)": [[15, "opacus.optimizers.ddpoptimizer.DistributedDPOptimizer"]], "add_noise() (opacus.optimizers.ddpoptimizer.distributeddpoptimizer method)": [[15, "opacus.optimizers.ddpoptimizer.DistributedDPOptimizer.add_noise"]], "opacus.optimizers.ddpoptimizer": [[15, "module-opacus.optimizers.ddpoptimizer"]], "step() (opacus.optimizers.ddpoptimizer.distributeddpoptimizer method)": [[15, "opacus.optimizers.ddpoptimizer.DistributedDPOptimizer.step"]], "distributedperlayeroptimizer (class in opacus.optimizers.ddp_perlayeroptimizer)": [[16, "opacus.optimizers.ddp_perlayeroptimizer.DistributedPerLayerOptimizer"]], "simpledistributedperlayeroptimizer (class in opacus.optimizers.ddp_perlayeroptimizer)": [[16, "opacus.optimizers.ddp_perlayeroptimizer.SimpleDistributedPerLayerOptimizer"]], "accumulated_iterations (opacus.optimizers.ddp_perlayeroptimizer.distributedperlayeroptimizer property)": [[16, "opacus.optimizers.ddp_perlayeroptimizer.DistributedPerLayerOptimizer.accumulated_iterations"]], "add_noise() (opacus.optimizers.ddp_perlayeroptimizer.distributedperlayeroptimizer method)": [[16, "opacus.optimizers.ddp_perlayeroptimizer.DistributedPerLayerOptimizer.add_noise"]], "clip_and_accumulate() (opacus.optimizers.ddp_perlayeroptimizer.distributedperlayeroptimizer method)": [[16, "opacus.optimizers.ddp_perlayeroptimizer.DistributedPerLayerOptimizer.clip_and_accumulate"]], "opacus.optimizers.ddp_perlayeroptimizer": [[16, "module-opacus.optimizers.ddp_perlayeroptimizer"]], "pre_step() (opacus.optimizers.ddp_perlayeroptimizer.distributedperlayeroptimizer method)": [[16, "opacus.optimizers.ddp_perlayeroptimizer.DistributedPerLayerOptimizer.pre_step"]], "dpoptimizer (class in opacus.optimizers.optimizer)": [[17, "opacus.optimizers.optimizer.DPOptimizer"]], "accumulated_iterations (opacus.optimizers.optimizer.dpoptimizer property)": [[17, "opacus.optimizers.optimizer.DPOptimizer.accumulated_iterations"]], "add_noise() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.add_noise"]], "attach_step_hook() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.attach_step_hook"]], "clip_and_accumulate() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.clip_and_accumulate"]], "grad_samples (opacus.optimizers.optimizer.dpoptimizer property)": [[17, "opacus.optimizers.optimizer.DPOptimizer.grad_samples"]], "load_state_dict() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.load_state_dict"]], "opacus.optimizers.optimizer": [[17, "module-opacus.optimizers.optimizer"]], "params (opacus.optimizers.optimizer.dpoptimizer property)": [[17, "opacus.optimizers.optimizer.DPOptimizer.params"]], "pre_step() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.pre_step"]], "scale_grad() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.scale_grad"]], "signal_skip_step() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.signal_skip_step"]], "state_dict() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.state_dict"]], "step() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.step"]], "zero_grad() (opacus.optimizers.optimizer.dpoptimizer method)": [[17, "opacus.optimizers.optimizer.DPOptimizer.zero_grad"]], "dpperlayeroptimizer (class in opacus.optimizers.perlayeroptimizer)": [[18, "opacus.optimizers.perlayeroptimizer.DPPerLayerOptimizer"]], "clip_and_accumulate() (opacus.optimizers.perlayeroptimizer.dpperlayeroptimizer method)": [[18, "opacus.optimizers.perlayeroptimizer.DPPerLayerOptimizer.clip_and_accumulate"]], "opacus.optimizers.perlayeroptimizer": [[18, "module-opacus.optimizers.perlayeroptimizer"]], "privacyengine (class in opacus.privacy_engine)": [[20, "opacus.privacy_engine.PrivacyEngine"]], "get_compatible_module() (opacus.privacy_engine.privacyengine class method)": [[20, "opacus.privacy_engine.PrivacyEngine.get_compatible_module"]], "get_epsilon() (opacus.privacy_engine.privacyengine method)": [[20, "opacus.privacy_engine.PrivacyEngine.get_epsilon"]], "is_compatible() (opacus.privacy_engine.privacyengine method)": [[20, "opacus.privacy_engine.PrivacyEngine.is_compatible"]], "make_private() (opacus.privacy_engine.privacyengine method)": [[20, "opacus.privacy_engine.PrivacyEngine.make_private"]], "make_private_with_epsilon() (opacus.privacy_engine.privacyengine method)": [[20, "opacus.privacy_engine.PrivacyEngine.make_private_with_epsilon"]], "opacus.privacy_engine": [[20, "module-opacus.privacy_engine"]], "save_checkpoint() (opacus.privacy_engine.privacyengine method)": [[20, "opacus.privacy_engine.PrivacyEngine.save_checkpoint"]], "validate() (opacus.privacy_engine.privacyengine method)": [[20, "opacus.privacy_engine.PrivacyEngine.validate"]], "are_state_dict_equal() (in module opacus.utils.module_utils)": [[22, "opacus.utils.module_utils.are_state_dict_equal"]], "clone_module() (in module opacus.utils.module_utils)": [[22, "opacus.utils.module_utils.clone_module"]], "get_submodule() (in module opacus.utils.module_utils)": [[22, "opacus.utils.module_utils.get_submodule"]], "opacus.utils.module_utils": [[22, "module-opacus.utils.module_utils"]], "parametrized_modules() (in module opacus.utils.module_utils)": [[22, "opacus.utils.module_utils.parametrized_modules"]], "requires_grad() (in module opacus.utils.module_utils)": [[22, "opacus.utils.module_utils.requires_grad"]], "trainable_modules() (in module opacus.utils.module_utils)": [[22, "opacus.utils.module_utils.trainable_modules"]], "trainable_parameters() (in module opacus.utils.module_utils)": [[22, "opacus.utils.module_utils.trainable_parameters"]], "compute_seq_lengths() (in module opacus.utils.packed_sequences)": [[23, "opacus.utils.packed_sequences.compute_seq_lengths"]], "opacus.utils.packed_sequences": [[23, "module-opacus.utils.packed_sequences"]], "calc_sample_norms() (in module opacus.utils.tensor_utils)": [[24, "opacus.utils.tensor_utils.calc_sample_norms"]], "calc_sample_norms_one_layer() (in module opacus.utils.tensor_utils)": [[24, "opacus.utils.tensor_utils.calc_sample_norms_one_layer"]], "filter_dilated_rows() (in module opacus.utils.tensor_utils)": [[24, "opacus.utils.tensor_utils.filter_dilated_rows"]], "opacus.utils.tensor_utils": [[24, "module-opacus.utils.tensor_utils"]], "sum_over_all_but_batch_and_last_n() (in module opacus.utils.tensor_utils)": [[24, "opacus.utils.tensor_utils.sum_over_all_but_batch_and_last_n"]], "unfold2d() (in module opacus.utils.tensor_utils)": [[24, "opacus.utils.tensor_utils.unfold2d"]], "unfold3d() (in module opacus.utils.tensor_utils)": [[24, "opacus.utils.tensor_utils.unfold3d"]], "distributeduniformwithreplacementsampler (class in opacus.utils.uniform_sampler)": [[25, "opacus.utils.uniform_sampler.DistributedUniformWithReplacementSampler"]], "uniformwithreplacementsampler (class in opacus.utils.uniform_sampler)": [[25, "opacus.utils.uniform_sampler.UniformWithReplacementSampler"]], "opacus.utils.uniform_sampler": [[25, "module-opacus.utils.uniform_sampler"]], "set_epoch() (opacus.utils.uniform_sampler.distributeduniformwithreplacementsampler method)": [[25, "opacus.utils.uniform_sampler.DistributedUniformWithReplacementSampler.set_epoch"]], "modulevalidator (class in opacus.validators.module_validator)": [[27, "opacus.validators.module_validator.ModuleValidator"]], "fix() (opacus.validators.module_validator.modulevalidator class method)": [[27, "opacus.validators.module_validator.ModuleValidator.fix"]], "fix_and_validate() (opacus.validators.module_validator.modulevalidator class method)": [[27, "opacus.validators.module_validator.ModuleValidator.fix_and_validate"]], "is_valid() (opacus.validators.module_validator.modulevalidator class method)": [[27, "opacus.validators.module_validator.ModuleValidator.is_valid"]], "opacus.validators.module_validator": [[27, "module-opacus.validators.module_validator"]], "opacus.validators.utils": [[27, "module-opacus.validators.utils"]], "register_module_fixer() (in module opacus.validators.utils)": [[27, "opacus.validators.utils.register_module_fixer"]], "register_module_validator() (in module opacus.validators.utils)": [[27, "opacus.validators.utils.register_module_validator"]], "validate() (opacus.validators.module_validator.modulevalidator class method)": [[27, "opacus.validators.module_validator.ModuleValidator.validate"]]}}) \ No newline at end of file