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

Move 5 tutorials from fluxml.github.io #2125

Merged
merged 11 commits into from
Nov 25, 2022
Merged

Move 5 tutorials from fluxml.github.io #2125

merged 11 commits into from
Nov 25, 2022

Conversation

mcabbott
Copy link
Member

This moves 5 pages from https://fluxml.ai/tutorials/ to the docs at https://fluxml.ai/Flux.jl/dev/, each of which builds & trains some model. Xref #2105 (comment) about moving them.

I have made no attempt to update them, the main change is replacing the blog's title + author format with an H1 and an !!! info block.

I have not checked that they run. Nor does this PR make any attempt to make CI run them.

They should certainly be updated to explicit parameters etc. (I presume that by having them in the docs, we are undertaking to keep them up to date, rather than being fixed-in-time blog posts.) But better to make the update a separate PR.

@github-actions
Copy link
Contributor

Once the build has completed, you can preview any updated documentation at this URL: https://fluxml.ai/Flux.jl/previews/PR2125/ in ~20 minutes

@codecov-commenter

This comment was marked as off-topic.

"Linear Regression" => "tutorials/linear_regression.md",
"Julia & Flux: 60 Minute Blitz" => "tutorials/2020-09-15-deep-learning-flux.md",
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about adding a 🚧 or some admonition in the tutorial itself so that users know this might be out of date? Or is the hope to have those sorted out before these hit a stable release?

Copy link
Member Author

Choose a reason for hiding this comment

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

Haven't seen one of those in a while! I don't think these are terribly out of date in fact, nothing looks like it clearly won't run.

Copy link
Member Author

Choose a reason for hiding this comment

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

Found a few places they needed to import params

Copy link
Member Author

@mcabbott mcabbott Nov 25, 2022

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

If we make them literate files, then copying over the model zoo files and deleting them from that repository would work. In the meantime, things can stay as they are.

save("./output.gif", gif_mat)
```

![](https://fluxml.ai/assets/tutorialposts/2021-10-08-dcgan-mnist/output.gif)
Copy link
Member

Choose a reason for hiding this comment

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

We might as well move the assets over so that everything is in one place. @ref links can be cleaned up later.

Copy link
Member Author

@mcabbott mcabbott Nov 25, 2022

Choose a reason for hiding this comment

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

I tried a bit locally, and gave up... IDK why I couldn't get relative links to work. Note that they are broken in the current website version too:

https://fluxml.ai/tutorialposts/2021-10-08-dcgan-mnist/#output

Copy link
Member

Choose a reason for hiding this comment

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

Ok, no use fighting them for a quick PR. I suspect the website links were also a victim of the Franklin migration.

Copy link
Member

@Saransh-cpp Saransh-cpp left a comment

Choose a reason for hiding this comment

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

Thanks, @mcabbott!!

I'll look into using Literate.jl for the tutorials.

Comment on lines 105 to 122
* `augment` augments the data by adding gaussian random noise to our image to make it more robust:

```julia
augment(x) = x .+ gpu(0.1f0*randn(eltype(x), size(x)))
```


* `anynan` checks whether any element of the params is NaN or not:

```julia
anynan(x) = any(y -> any(isnan, y), x)
```

* `accuracy` computes the accuracy of our ConvNet:

```julia
accuracy(x, y, model) = mean(onecold(cpu(model(x))) .== onecold(cpu(y)))
```
Copy link
Member

Choose a reason for hiding this comment

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

I think the indented julia blocks are making the output look weird. Maybe unindent them for now?

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks I missed that.

@Saransh-cpp
Copy link
Member

Also, should the Dataloader example go in a new "How to" sections in Flux's docs?

Just saw #2115, which aims to separate out the references from the guide. Should we have a single guide section (as suggested by @mcabbott) and move all the "How to" guides under this heading?

@mcabbott
Copy link
Member Author

mcabbott commented Nov 25, 2022

should the Dataloader example go in a new "How to" sections

IDK. What else goes in there?

Lots of the reference sections do start with some text, to supplement the docstrings. The logical place to add something sounds like the MLUtils page. But probably not the exact text, since it's long and doesn't say much?

https://fluxml.ai/Flux.jl/stable/destructure/
https://fluxml.ai/Flux.jl/stable/data/onehot/

Alternatively, a bigger "data handling" or something tutorial, which introduces how to read CSV files and image files and so on, as well as data-handling tools, might be nice to have if someone wants to write it.

Maybe this is similar to what you picture the "how to" section being -- tutuorial-style pages, but not data-model-train-test examples, instead walk-throughs of other things?

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

Successfully merging this pull request may close these issues.

4 participants