cleaned up for submission

This commit is contained in:
2026-07-10 20:13:13 +02:00
parent 47fbb19761
commit 7eff030e89
38 changed files with 39 additions and 4175 deletions

View File

@@ -7,7 +7,6 @@ from unlearning.Strategy import Strategy
from sets.Data import *
# Single-Batch Certified Unlearning for DNNs
class CertifiedUnlearning(Strategy):
"""
Implements Certified Unlearning for non-convex DNNs (Zhang et al.).
@@ -47,8 +46,7 @@ class CertifiedUnlearning(Strategy):
params_list = []
for name, p in inner_model.named_parameters():
if p.requires_grad:
# Append as a tuple so it can be unpacked as (name, param)
# so it can be unpacked as (name, param)
params_list.append((name, p))
return params_list if named else [e[1] for e in params_list]
@@ -133,7 +131,7 @@ class CertifiedUnlearning(Strategy):
h_estimate[k].copy_(h_estimate[k] + g[k] - (h_s[k] / self.scale))
# feed back on status
# feed back because this took agaes and it was not clear if things were working
if global_step % step_interval == 0 and current_pct < 100:
current_pct += 1
print(f"\rProgress: {current_pct}% done", end="", flush=True)
@@ -167,7 +165,7 @@ class CertifiedUnlearning(Strategy):
# Keep early low-level vision filters entirely pristine
pass
# Move to the next calculated Hessian vector block only after a valid update step
# to the next calculated Hessian vector block
delta_idx += 1
return model