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

Basic examples fixes #5912

Merged
merged 37 commits into from
Feb 16, 2021
Merged

Conversation

ddrevicky
Copy link
Contributor

@ddrevicky ddrevicky commented Feb 10, 2021

What does this PR do?

  • Fixes broken links to basic_examples models in pl_examples/README.md
  • Fixes wrong paths to models in basic_examples README (e.g., mnist.py does not exist)
  • Adds missing validation and test steps to basic_examples/autoencoder.py
  • Uses DATASET_PATHS variable for storing downloaded datasets for examples in files where it was not used

Random question

When defining a validation/test step could the following code be used? Or does calling training_step undesirably modify the model weights + other internal stuff?

# Same for test_step
def validation_step(self, batch, batch_idx):
    loss = self.training_step(batch, batch_idx)
    self.log('valid_loss', loss, on_step=True)

Before submitting

  • Was this discussed/approved via a GitHub issue? (not for typos and docs)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you update the CHANGELOG? (not for typos, docs, test updates, or internal minor changes/refactorings)

PR review

Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:

  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified
  • Check that target branch and milestone match!

Did you have fun?

Make sure you had fun coding 🙃

@codecov
Copy link

codecov bot commented Feb 10, 2021

Codecov Report

Merging #5912 (a61ca1d) into master (fcfa7fa) will decrease coverage by 59%.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           master   #5912     +/-   ##
========================================
- Coverage      90%     31%    -59%     
========================================
  Files         170     170             
  Lines       11784   11663    -121     
========================================
- Hits        10664    3661   -7003     
- Misses       1120    8002   +6882     

Base automatically changed from master to release/1.1.x February 11, 2021 14:30
@Borda
Copy link
Member

Borda commented Feb 12, 2021

@ddrevicky thank you for sending your PR, just a minor issue coming from our side... we have swapped branches regarding upcoming feat 1.2, mind rebase on actual master? if needed see How to fix PR with mixed base and target branches?

@Borda Borda changed the base branch from release/1.1.x to master February 12, 2021 10:01
@ddrevicky ddrevicky force-pushed the basic-examples-fixes branch from b3e5ca7 to e026c3c Compare February 12, 2021 11:16
@mergify mergify bot removed the has conflicts label Feb 12, 2021
@carmocca
Copy link
Contributor

When defining a validation/test step could the following code be used? Or does calling training_step undesirably modify the model weights + other internal stuff?

Yes. That can be done with no issues

@carmocca carmocca added this to the 1.3 milestone Feb 12, 2021
@carmocca carmocca added bug Something isn't working example labels Feb 12, 2021
Copy link
Contributor

@tchaton tchaton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM !

z = self.encoder(x)
x_hat = self.decoder(z)
loss = F.mse_loss(x_hat, x)
self.log('valid_loss', loss, on_step=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is usually no need to log on step for validation :)

@Borda Borda merged commit c5919fd into Lightning-AI:master Feb 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working example ready PRs ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants