diff options
author | Ssslakter <67190162+Ssslakter@users.noreply.github.com> | 2023-09-11 02:36:29 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-10 20:36:29 +0100 |
commit | 18d6db2180800dcc134ffabe8523a774c6a7f9a3 (patch) | |
tree | 652827956e2d68b8e8b6b97db7c4eacb2c6fdb1d /candle-book | |
parent | 4f18180fc7564b9a02cab13c4acda0ac7b17a799 (diff) | |
download | candle-18d6db2180800dcc134ffabe8523a774c6a7f9a3.tar.gz candle-18d6db2180800dcc134ffabe8523a774c6a7f9a3.tar.bz2 candle-18d6db2180800dcc134ffabe8523a774c6a7f9a3.zip |
more doc fixes (#804)
Diffstat (limited to 'candle-book')
-rw-r--r-- | candle-book/src/SUMMARY.md | 4 | ||||
-rw-r--r-- | candle-book/src/guide/hello_world.md | 16 | ||||
-rw-r--r-- | candle-book/src/inference/inference.md (renamed from candle-book/src/inference/README.md) | 0 | ||||
-rw-r--r-- | candle-book/src/training/training.md (renamed from candle-book/src/training/README.md) | 0 |
4 files changed, 10 insertions, 10 deletions
diff --git a/candle-book/src/SUMMARY.md b/candle-book/src/SUMMARY.md index 8228da22..e92f298f 100644 --- a/candle-book/src/SUMMARY.md +++ b/candle-book/src/SUMMARY.md @@ -10,10 +10,10 @@ # Reference Guide -- [Running a model](inference/README.md) +- [Running a model](inference/inference.md) - [Using the hub](inference/hub.md) - [Error management](error_manage.md) -- [Training](training/README.md) +- [Training](training/training.md) - [MNIST](training/mnist.md) - [Fine-tuning]() - [Serialization]() diff --git a/candle-book/src/guide/hello_world.md b/candle-book/src/guide/hello_world.md index 74a147e7..b5b8d7b4 100644 --- a/candle-book/src/guide/hello_world.md +++ b/candle-book/src/guide/hello_world.md @@ -6,7 +6,7 @@ Open `src/main.rs` and fill in this content: ```rust # extern crate candle_core; -use candle_core::{DType, Device, Result, Tensor}; +use candle_core::{Device, Result, Tensor}; struct Model { first: Tensor, @@ -29,7 +29,7 @@ fn main() -> Result<()> { let second = Tensor::randn(0f32, 1.0, (100, 10), &device)?; let model = Model { first, second }; - let dummy_image = Tensor::zeros((1, 784), DType::F32, &device)?; + let dummy_image = Tensor::randn(0f32, 1.0, (1, 784), &device)?; let digit = model.forward(&dummy_image)?; println!("Digit {digit:?} digit"); @@ -50,7 +50,7 @@ the classical `Linear` layer. We can do as such ```rust # extern crate candle_core; -# use candle_core::{DType, Device, Result, Tensor}; +# use candle_core::{Device, Result, Tensor}; struct Linear{ weight: Tensor, bias: Tensor, @@ -80,7 +80,7 @@ This will change the model running code into a new function ```rust # extern crate candle_core; -# use candle_core::{DType, Device, Result, Tensor}; +# use candle_core::{Device, Result, Tensor}; # struct Linear{ # weight: Tensor, # bias: Tensor, @@ -111,7 +111,7 @@ fn main() -> Result<()> { // Creating a dummy model let weight = Tensor::randn(0f32, 1.0, (784, 100), &device)?; - let bias = Tensor::zeros((100, ), DType::F32, &device)?; + let bias = Tensor::randn(0f32, 1.0, (100, ), &device)?; let first = Linear{weight, bias}; let weight = Tensor::randn(0f32, 1.0, (100, 10), &device)?; let bias = Tensor::randn(0f32, 1.0, (10, ), &device)?; @@ -146,7 +146,7 @@ And rewrite our examples using it ```rust # extern crate candle_core; # extern crate candle_nn; -use candle_core::{DType, Device, Result, Tensor}; +use candle_core::{Device, Result, Tensor}; use candle_nn::{Linear, Module}; struct Model { @@ -189,7 +189,7 @@ Feel free to modify this example to use `Conv2d` to create a classical convnet i Now that we have the running dummy code we can get to more advanced topics: - [For PyTorch users](../guide/cheatsheet.md) -- [Running existing models](../inference/README.md) -- [Training models](../training/README.md) +- [Running existing models](../inference/inference.md) +- [Training models](../training/training.md) diff --git a/candle-book/src/inference/README.md b/candle-book/src/inference/inference.md index 1b75a310..1b75a310 100644 --- a/candle-book/src/inference/README.md +++ b/candle-book/src/inference/inference.md diff --git a/candle-book/src/training/README.md b/candle-book/src/training/training.md index d68a917e..d68a917e 100644 --- a/candle-book/src/training/README.md +++ b/candle-book/src/training/training.md |