unlearning done
This commit is contained in:
@@ -7,7 +7,7 @@ import time
|
||||
import numpy as np
|
||||
from sklearn.metrics import classification_report
|
||||
from pathlib import Path
|
||||
from unlearning.Strategy import Strategy
|
||||
#from unlearning.Strategy import Strategy
|
||||
import copy
|
||||
from torch.optim.lr_scheduler import CosineAnnealingLR
|
||||
|
||||
@@ -84,7 +84,7 @@ class Model(ABC):
|
||||
print(f'Model loaded from {file_path}')
|
||||
|
||||
|
||||
def unlearn(self, strategy: Strategy, forget_loader, retain_loader):
|
||||
def unlearn(self, strategy: 'Strategy', forget_loader, retain_loader):
|
||||
""" Executes a targeted unlearning strategy and profiles efficiency """
|
||||
print(f"Executing: {strategy.__class__.__name__}...")
|
||||
|
||||
@@ -103,6 +103,7 @@ class Model(ABC):
|
||||
Evaluates the model, prints terminal reports, and routes metrics to
|
||||
a file logger based on the current context mode.
|
||||
"""
|
||||
|
||||
self.model.eval()
|
||||
all_preds, all_labels = [], []
|
||||
print(f"\nEvaluating Domain: [{mode}]...")
|
||||
|
||||
Reference in New Issue
Block a user