Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ayushkumartarun/zero-shot-unlearning
/ functions
Functions
47 in github.com/ayushkumartarun/zero-shot-unlearning
⨍
Functions
47
◇
Types & classes
11
↓ 8 callers
Method
__init__
(self, in_channels, out_channels, kernel_size=3, stride=1, padding=None, output_padding=0, ac
models.py:41
↓ 8 callers
Function
evaluate
(model, val_loader, device='cuda')
utils.py:37
↓ 3 callers
Function
collect_prob
(data_loader, model)
metrics.py:6
↓ 3 callers
Function
entropy
(p, dim = -1, keepdim = False)
metrics.py:3
↓ 2 callers
Function
attention
Taken from https://github.com/szagoruyko/attention-transfer :param x = activations
unlearn.py:9
↓ 2 callers
Function
divergence
(student_logits, teacher_logits, KL_temperature)
unlearn.py:26
↓ 2 callers
Function
relearn_time
(model, train_loader, valid_loader, reqAcc, lr)
metrics.py:37
↓ 2 callers
Function
training_step
(model, batch, device)
utils.py:10
↓ 1 callers
Method
__init__
(self, z_dim, num_channels = 3)
unlearn.py:56
↓ 1 callers
Function
accuracy
(outputs, labels)
utils.py:6
↓ 1 callers
Function
attention_diff
Taken from https://github.com/szagoruyko/attention-transfer :param x = activations :param y = activations
unlearn.py:17
↓ 1 callers
Function
epoch_end
(model, epoch, result)
utils.py:32
↓ 1 callers
Function
get_lr
(optimizer)
utils.py:42
↓ 1 callers
Function
get_membership_attack_data
(retain_loader, forget_loader, test_loader, model)
metrics.py:17
↓ 1 callers
Method
reset_parameters
(self)
models.py:32
↓ 1 callers
Function
validation_epoch_end
(model, outputs)
utils.py:25
↓ 1 callers
Function
validation_step
(model, batch, device)
utils.py:17
Function
KT_loss_generator
(student_logits, teacher_logits, KL_temperature)
unlearn.py:32
Function
KT_loss_student
(student_logits, student_activations, teacher_logits, teacher_activations, KL_temperature = 1, AT_beta = 250)
unlearn.py:40
Method
__init__
(self)
models.py:7
Method
__init__
(self)
models.py:14
Method
__init__
(self, in_channels, out_channels, kernel_size=3, stride=1, padding=None, output_padding=0, w_sig =\
models.py:21
Method
__init__
(self, filters_percentage=1., n_channels=3, num_classes=10, dropout=False, batch_norm=True)
models.py:60
Method
__init__
(self, size)
models.py:128
Method
__init__
(self, n_classes)
models.py:137
Method
__init__
(self, in_channels, out_channels, kernel_size, padding, stride)
models.py:172
Method
__init__
(self)
models.py:211
Method
__init__
Infinite loader, which contains a learnable generator.
unlearn.py:100
Method
__iter__
(self)
unlearn.py:139
Method
__next__
(self)
unlearn.py:115
Function
ain
(full_model, model, gold_model, train_data, val_retain, val_forget, batch_size = 256, error
metrics.py:68
Function
cifar10
(root = './')
datasets.py:9
Function
fit_one_cycle
(epochs, max_lr, model, train_loader, val_loader, weight_decay=0, grad_clip=None, opt_func=
utils.py:46
Method
forward
(self, x)
models.py:10
Method
forward
(self,x)
models.py:16
Method
forward
(self, input)
models.py:37
Method
forward
(self, x)
models.py:89
Method
forward
(self, tensor)
models.py:132
Method
forward
(self, x, true_labels=None)
models.py:156
Method
forward
(self, x)
models.py:193
Method
forward
(self, x)
models.py:237
Method
forward
(self, z)
unlearn.py:86
Function
get_membership_attack_prob
(retain_loader, forget_loader, test_loader, model)
metrics.py:29
Function
mnist
(root = './')
datasets.py:43
Method
print_shape
For debugging purposes
unlearn.py:89
Method
samples
:return: if grid returns single grid image, else returns n images.
unlearn.py:124
Function
svhn
(root = './')
datasets.py:32