-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Print module part3 - Update book (#1940)
* Update book example guide * Update Module book section on module display
- Loading branch information
Showing
8 changed files
with
164 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use burn::{backend::Wgpu, data::dataset::Dataset}; | ||
use guide::inference; | ||
|
||
fn main() { | ||
type MyBackend = Wgpu<f32, i32>; | ||
|
||
let device = burn::backend::wgpu::WgpuDevice::default(); | ||
|
||
// All the training artifacts are saved in this directory | ||
let artifact_dir = "/tmp/guide"; | ||
|
||
// Infer the model | ||
inference::infer::<MyBackend>( | ||
artifact_dir, | ||
device, | ||
burn::data::dataset::vision::MnistDataset::test() | ||
.get(42) | ||
.unwrap(), | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use burn::backend::Wgpu; | ||
use guide::model::ModelConfig; | ||
|
||
fn main() { | ||
type MyBackend = Wgpu<f32, i32>; | ||
|
||
let device = Default::default(); | ||
let model = ModelConfig::new(10, 512).init::<MyBackend>(&device); | ||
|
||
println!("{}", model); | ||
} |
22 changes: 14 additions & 8 deletions
22
examples/guide/src/main.rs → examples/guide/src/bin/train.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters