-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87854b3
commit b326cb0
Showing
4 changed files
with
134 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,26 @@ | ||
from typing import Type | ||
|
||
from base.datasets_processing import DatasetManager | ||
|
||
|
||
class Defender: | ||
name = "Defender" | ||
|
||
def __init__(self): | ||
def __init__( | ||
self | ||
): | ||
pass | ||
|
||
def defense_diff(self): | ||
def defense_diff( | ||
self | ||
): | ||
pass | ||
|
||
@staticmethod | ||
def check_availability(gen_dataset, model_manager): | ||
def check_availability( | ||
gen_dataset: DatasetManager, | ||
model_manager: Type | ||
): | ||
return False | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,39 @@ | ||
from defense.defense_base import Defender | ||
|
||
|
||
class MIDefender(Defender): | ||
def __init__(self, **kwargs): | ||
class MIDefender( | ||
Defender | ||
): | ||
def __init__( | ||
self, | ||
**kwargs | ||
): | ||
super().__init__() | ||
|
||
def pre_batch(self, **kwargs): | ||
def pre_batch( | ||
self, | ||
**kwargs | ||
): | ||
pass | ||
|
||
def post_batch(self, **kwargs): | ||
def post_batch( | ||
self, | ||
**kwargs | ||
): | ||
pass | ||
|
||
|
||
class EmptyMIDefender(MIDefender): | ||
name = "EmptyMIDefender" | ||
|
||
def pre_batch(self, **kwargs): | ||
def pre_batch( | ||
self, | ||
**kwargs | ||
): | ||
pass | ||
|
||
def post_batch(self, **kwargs): | ||
def post_batch( | ||
self, | ||
**kwargs | ||
): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters