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

Fixup Dataloader's docstring #1635

Merged
merged 6 commits into from
Jul 2, 2021
Merged

Fixup Dataloader's docstring #1635

merged 6 commits into from
Jul 2, 2021

Conversation

mcabbott
Copy link
Member

@mcabbott mcabbott commented Jun 27, 2021

This makes the Dataloader example into a jldoctest, and adds a friendly error if you mess up the sizes.

DataLoader was exported from Data, but accessible only as (deep breath) Flux.Data.DataLoader because the module was not imported. I take it that's a mistake, because of the export statement. So I fixed it.

Note that julia> Flux.DataL<tab> still doesn't find it. Perhaps we can murder some sub-modules once the datasets currently residing in Data are removed.

(Test failure on nightly ought to be fixed by FluxML/NNlibCUDA.jl#15, but CI gets the old version?)

ToucheSir
ToucheSir previously approved these changes Jul 2, 2021
Copy link
Member

@ToucheSir ToucheSir left a comment

Choose a reason for hiding this comment

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

LGTM, also not sure why the REPL autocomplete wouldn't work.

for (x, y) in train_loader # access via tuple destructuring
@assert size(x) == (10, 5)
@assert size(y) == (5,)
# loss += f(x, y) # etc, runs 100 * 20 times
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
# loss += f(x, y) # etc, runs 100 * 20 times

src/data/dataloader.jl Outdated Show resolved Hide resolved
Copy link
Member

@DhairyaLGandhi DhairyaLGandhi left a comment

Choose a reason for hiding this comment

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

bors r+

@DhairyaLGandhi
Copy link
Member

By the by, the suggestion was to note that the minibatches respect the keys of the named tuple as given in the input dataset. I think it got lost in the GitHub commits.

@bors
Copy link
Contributor

bors bot commented Jul 2, 2021

Build succeeded:

@bors bors bot merged commit 9410677 into FluxML:master Jul 2, 2021
@mcabbott mcabbott deleted the dataloader branch July 2, 2021 23:52
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.

3 participants