generated from ashleve/lightning-hydra-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move batch_c15n out of Adversary (#220)
* Move batch_c15n to AdversaryConnector. * Move configs from /attack/batch_c15n to /batch_c15n. * Move mart/attack/batch_c15n.py to mart/transfroms. * Fix test. * Use non-keyword arguments in Adversary.forward() for simplicity. * Comment. * Use non-keyword arguments for input and target in Adversary.fit() for simplicity. * Fix a bug. * Add test. * Simplify if-else for LightningModule. * Update test. * Set a tuple batch_c15n by default in the adversary connector callback, since datamodules in MART often give a batch=(input, target).
- Loading branch information
Showing
18 changed files
with
112 additions
and
87 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
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
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 |
---|---|---|
|
@@ -12,4 +12,3 @@ gradient_modifier: null | |
objective: null | ||
enforcer: ??? | ||
attacker: null | ||
batch_c15n: ??? |
This file was deleted.
Oops, something went wrong.
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
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
2 changes: 1 addition & 1 deletion
2
mart/configs/attack/batch_c15n/dict.yaml → mart/configs/batch_c15n/dict.yaml
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,3 +1,3 @@ | ||
# We expect the original batch looks like `{"input": tensor, ...}` with the default parameters. | ||
_target_: mart.attack.batch_c15n.DictBatchC15n | ||
_target_: mart.transforms.DictBatchC15n | ||
input_key: input |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
_target_: mart.transforms.InputOnlyBatchC15n |
2 changes: 1 addition & 1 deletion
2
mart/configs/attack/batch_c15n/list.yaml → mart/configs/batch_c15n/list.yaml
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,4 +1,4 @@ | ||
# We expect the original batch looks like `[input, target]` with the default parameters. | ||
_target_: mart.attack.batch_c15n.ListBatchC15n | ||
_target_: mart.transforms.ListBatchC15n | ||
input_key: 0 | ||
target_size: 1 |
2 changes: 1 addition & 1 deletion
2
mart/configs/attack/batch_c15n/tuple.yaml → mart/configs/batch_c15n/tuple.yaml
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,4 +1,4 @@ | ||
# We expect the original batch looks like `(input, target)` with the default parameters. | ||
_target_: mart.attack.batch_c15n.TupleBatchC15n | ||
_target_: mart.transforms.TupleBatchC15n | ||
input_key: 0 | ||
target_size: 1 |
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
File renamed without changes.
Oops, something went wrong.