Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cifar100 wrn404 regularization #31

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

f-dangel
Copy link

@f-dangel f-dangel commented Aug 3, 2020

Problem: cifar100_wrn404 forward pass is not working when adding regularization.

This is caused by a missing return statement that creates the regularization groups.

Demo:

  • Before: Forward pass without regularization passes, forward pass with regularization raises AttributeError: 'NoneType' object has no attribute 'items'
  • After: Both forward passes work
from deepobs.pytorch.testproblems import cifar100_wrn404

tp = cifar100_wrn404(5)
tp.set_up()
tp.train_init_op()

# works
loss, _ = tp.get_batch_loss_and_accuracy(add_regularization_if_available=False)
print(loss)

# crashes
regularized_loss, _ = tp.get_batch_loss_and_accuracy(
    add_regularization_if_available=True
)
print(regularized_loss)

Minor:

  • Moved testproblem set_up method to __init__ of test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant