Conversation
This reverts commit 01a2066.
dxoigmn
commented
Jun 23, 2023
dxoigmn
commented
Jun 23, 2023
dxoigmn
commented
Jun 23, 2023
| # We can omit the key of _call_with_args_ if it is the only config. | ||
| module_cfg = {"_call_with_args_": module_cfg} | ||
|
|
||
| # Add support for calling different functions using dot-syntax |
Member
Author
There was a problem hiding this comment.
Move _call_ functionality to new PR.
dxoigmn
commented
Jun 23, 2023
Comment on lines
+106
to
+108
| # Turn tuple of dicts into dict of tuples | ||
| new_targets = {k: tuple(t[k] for t in targets) for k in targets[0].keys()} | ||
| new_targets["list_of_targets"] = targets |
Member
Author
There was a problem hiding this comment.
Would be nice to get rid of this...
Member
Author
There was a problem hiding this comment.
Basically, we either need to decide to accept a List[Tensor] for input and List[Dict[str, Tensor]] for target or Tensor for input and Dict[str, Tensor] for target. The former interface at least allows images with different shapes and sizes even if the underlying network does not.
This was referenced Jun 23, 2023
Closed
Closed
Closed
dxoigmn
commented
Jun 28, 2023
| return super().forward(*values, weights=weights) | ||
|
|
||
| def _total_variation(self, image): | ||
| return torch.mean( |
Member
Author
There was a problem hiding this comment.
Mean doesn't do anything and we should probably normalize this by the size of the patch (e.g., C*H*W).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This obseletes #135 and #177. However, we should wait to merge this until we can remove the detection code and directly use torchvision.
Type of change
Please check all relevant options.
Testing
Please describe the tests that you ran to verify your changes. Consider listing any relevant details of your test configuration.
pytestCUDA_VISIBLE_DEVICES=0 python -m mart experiment=CIFAR10_CNN_Adv trainer=gpu trainer.precision=16reports 70% (21 sec/epoch).CUDA_VISIBLE_DEVICES=0,1 python -m mart experiment=CIFAR10_CNN_Adv trainer=ddp trainer.precision=16 trainer.devices=2 model.optimizer.lr=0.2 trainer.max_steps=2925 datamodule.ims_per_batch=256 datamodule.world_size=2reports 70% (14 sec/epoch).Before submitting
pre-commit run -acommand without errorsDid you have fun?
Make sure you had fun coding 🙃