MCPcopy Create free account

hub / github.com/LAION-AI/watermark-detection / functions

Functions56 in github.com/LAION-AI/watermark-detection

↓ 3 callersMethod__init__
(self, hps, unused_var)
training/scalable_shampoo/shampoo.py:73
↓ 3 callersMethodstep
(self, closure=None)
training/scalable_shampoo/shampoo.py:328
↓ 3 callersFunctiontest_model
(model, criterion, test_dl, device, prefix, batch_size, test_dl_len=None, fp16=False)
training/train_watermark.py:87
↓ 2 callersMethodadd_statistics
(self, grad)
training/scalable_shampoo/shampoo.py:76
↓ 2 callersFunctionget_dataset
(path, batch_size, is_laion=False, is_train=False)
training/train_watermark.py:82
↓ 2 callersFunctionnum_to_sym
(num)
training/train_watermark.py:149
↓ 2 callersFunctionparse_output
(output)
training/train_watermark.py:153
↓ 2 callersMethodpartition
Partition tensor into blocks.
training/scalable_shampoo/shampoo.py:156
↓ 1 callersFunctionMatPower
Computes mat_m^p, for p a positive integer. Args: mat_m: a square matrix p: a positive integer Returns: mat_m^p
training/scalable_shampoo/matrix_functions.py:51
↓ 1 callersFunctionPowerIter
Power iteration. Compute the maximum eigenvalue of mat, for scaling. v is a random vector with values in (-1, 1) Args: mat_g: the symmetri
training/scalable_shampoo/matrix_functions.py:21
↓ 1 callersFunction_merge_small_dims
Merge small dimensions. If there are some small dimensions, we collapse them: e.g. [1, 2, 512, 1, 2048, 1, 3, 4] --> [1024, 2048, 12] if max_dim
training/scalable_shampoo/shampoo.py:185
↓ 1 callersMethodcompute_preconditioners
Compute L^{-1/exp} for each stats matrix L.
training/scalable_shampoo/shampoo.py:261
↓ 1 callersMethodexponent_for_preconditioner
Returns exponent to use for inverse-pth root M^{-1/p}.
training/scalable_shampoo/shampoo.py:255
↓ 1 callersFunctionget_args
()
training/train_watermark.py:167
↓ 1 callersFunctionget_args
()
training/eval_watermark.py:140
↓ 1 callersFunctionget_dataset
(path, batch_size, only_watermark=False, only_clear=False)
training/eval_watermark.py:61
↓ 1 callersFunctionget_load_mapping
(is_laion)
training/train_watermark.py:44
↓ 1 callersFunctionget_optimizer
(name)
training/train_watermark.py:158
↓ 1 callersFunctionget_process_map
(is_train)
training/train_watermark.py:75
↓ 1 callersFunctionget_samples
(im, txt, syms, batch_size, log_all_images=False)
training/eval_watermark.py:70
↓ 1 callersMethodinit_var_state
Initialize the PyTorch state of for a single variable.
training/scalable_shampoo/shampoo.py:316
↓ 1 callersMethodmerge_partitions
Merge partitions back to original shape.
training/scalable_shampoo/shampoo.py:169
↓ 1 callersMethodnum_splits
(self)
training/scalable_shampoo/shampoo.py:153
↓ 1 callersFunctionnum_to_sym
(num)
training/eval_watermark.py:131
↓ 1 callersFunctionparse_output
(output)
training/eval_watermark.py:135
↓ 1 callersMethodprecondition_gradient
(self, grad)
training/scalable_shampoo/shampoo.py:79
↓ 1 callersMethodpreconditioned_grad
Precondition the gradient. Args: grad: A gradient tensor to precondition. Returns: A preconditioned gradient.
training/scalable_shampoo/shampoo.py:269
↓ 1 callersFunctionsave_to_wandb
(model_path)
training/train_watermark.py:127
↓ 1 callersMethodshapes_for_preconditioners
(self)
training/scalable_shampoo/shampoo.py:150
↓ 1 callersFunctiontest_model
(model, criterion, test_dl, device, batch_size, prefix, fp16=False, log_all_images=False)
training/eval_watermark.py:78
↓ 1 callersMethodupdate_momentum
(self, update, unused_beta1)
training/scalable_shampoo/shampoo.py:82
FunctionComputePower
A method to compute G^{-1/p} using a coupled Newton iteration. See for example equation 3.2 on page 9 of: A Schur-Newton Method for the Matrix p-
training/scalable_shampoo/matrix_functions.py:79
Method__init__
(self, hps, var)
training/scalable_shampoo/shampoo.py:92
Method__init__
(self, hps, var)
training/scalable_shampoo/shampoo.py:107
Method__init__
(self, var, hps)
training/scalable_shampoo/shampoo.py:126
Method__init__
(self, var, hps)
training/scalable_shampoo/shampoo.py:216
Method__init__
(self, params, lr=1.0, momentum=0.9, hyperparams=S
training/scalable_shampoo/shampoo.py:307
Methodadd_statistics
(self, grad)
training/scalable_shampoo/shampoo.py:111
Methodadd_statistics
Compute statistics from gradients and add to the correct state entries. Args: grad: Gradient to compute statistics from.
training/scalable_shampoo/shampoo.py:237
Functionbe
(s)
training/train_watermark.py:200
Functioncompute_splits
Splits larger dimensions into smaller ones, for preconditioning. For example, if a variable has shape (4096, 512), we might split the 4096 into 4
training/scalable_shampoo/shampoo_utils.py:56
Functionfilter_dataset_only_clear
(sample)
training/eval_watermark.py:57
Functionfilter_dataset_only_watermark
(sample)
training/eval_watermark.py:53
Functionload_image
(jpg)
training/train_watermark.py:29
Functionload_image
(jpg)
training/eval_watermark.py:19
Functionload_text
(txt)
training/eval_watermark.py:26
Functionload_text_laion
(__key__)
training/train_watermark.py:40
Functionload_text_watervit
(txt)
training/train_watermark.py:36
Functionmerge_grads
Merge the split gradients back into a single array.
training/scalable_shampoo/shampoo_utils.py:99
Functionmerge_small_dims
Computes the shape of the variable for preconditioning. If the variable has several small dimensions, we can reshape it so that there are fewer b
training/scalable_shampoo/shampoo_utils.py:28
Methodprecondition_gradient
(self, grad)
training/scalable_shampoo/shampoo.py:114
Functionprocess_text
(num)
training/train_watermark.py:55
Functionprocess_text
(num)
training/eval_watermark.py:36
Functionsave_model
(model, optimizer, scheduler, dir, deepspeed, epoch)
training/train_watermark.py:133
Functionsplit_grad
Split up the gradient according to the blocking strategy.
training/scalable_shampoo/shampoo_utils.py:86
Methodupdate_momentum
(self, update, beta1)
training/scalable_shampoo/shampoo.py:96