-
Notifications
You must be signed in to change notification settings - Fork 931
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
Starting the book. #258
Starting the book. #258
Conversation
Friendly ping for review. |
candle-book/src/guide/hello_world.md
Outdated
|
||
We will now create the hello world of the ML world, building a model capable of solving MNIST dataset. | ||
|
||
Open `src/main.rs` and fill in with these contents: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these contents -> this content?
Also maybe we should have a repo with the actual files so that it's easier for people that just want to copy the files around?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed typo.
I'm hesitant for the final repo, I'm sure we're not going to keep it enough up to date and currently there's very little content.
But maybe later when the doc grows( and we could inner include too).
candle-book/src/guide/hello_world.md
Outdated
|
||
## Using a `Linear` layer. | ||
|
||
Now that we have this, we might want to complexity a little, for instance by adding `bias` and creating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to complexity a little -> to complexify things a bit or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed !
candle-book/src/guide/hello_world.md
Outdated
} | ||
``` | ||
|
||
This will change the loading code into a new function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure to understand what "loading code" means in this context, maybe more "model code" or "model running code"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I was referring to the loading take up more space.
candle-book/src/guide/hello_world.md
Outdated
# } | ||
fn main() -> Result<()> { | ||
// Use Device::new_cuda(0)?; to use the GPU. | ||
let device = Device::Cpu; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cuda_if_available
is nice for this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice indeed. I'll leave the other options in comment, seems core if you need to make sure when a model executes.
|
||
## Using `candle_nn`. | ||
|
||
For instance [Linear](https://github.com/LaurentMazare/candle/blob/main/candle-nn/src/linear.rs) is already there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the crates are published this should probably point at docs.rs instead of the code as it's nicer for users to look at.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fully agree but we said we'd write it first :)
} | ||
``` | ||
|
||
Feel free to modify this example to use `Conv2d` to create a classical convnet instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which Conv2d
? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exercise left to the user.
``` | ||
|
||
At this point, candle will be built **without** CUDA support. | ||
To get CUDA support use the feature `cuda` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the feature cuda
-> the cuda
feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
View: https://laurentmazare.github.io/candle/
Tests work : https://github.com/LaurentMazare/candle/actions/runs/5679581242/job/15392008564