forked from tracel-ai/burn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't enable training by default; add cli feature flag
Partially implements tracel-ai#729: - The burn crate no longer enables the training module unless the train feature is enabled. - Added a new train-cli feature to enable the metric plotting/CLI rendering.
- Loading branch information
Showing
12 changed files
with
100 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
use crate::metric::dashboard::{DashboardMetricState, DashboardRenderer, TrainingProgress}; | ||
|
||
/// A simple renderer for when the cli feature is not enabled. | ||
pub struct CLIDashboardRenderer; | ||
|
||
impl CLIDashboardRenderer { | ||
/// Create a new instance. | ||
pub fn new() -> Self { | ||
Self {} | ||
} | ||
} | ||
|
||
impl DashboardRenderer for CLIDashboardRenderer { | ||
fn update_train(&mut self, _state: DashboardMetricState) {} | ||
|
||
fn update_valid(&mut self, _state: DashboardMetricState) {} | ||
|
||
fn render_train(&mut self, item: TrainingProgress) { | ||
dbg!(item); | ||
} | ||
|
||
fn render_valid(&mut self, item: TrainingProgress) { | ||
dbg!(item); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,8 +1,16 @@ | ||
/// Command line interface module for the dashboard. | ||
pub mod cli; | ||
#[cfg(feature = "cli")] | ||
mod cli; | ||
#[cfg(not(feature = "cli"))] | ||
mod cli_stub; | ||
|
||
mod base; | ||
mod plot; | ||
|
||
pub use base::*; | ||
pub use plot::*; | ||
|
||
#[cfg(feature = "cli")] | ||
pub use cli::CLIDashboardRenderer; | ||
#[cfg(not(feature = "cli"))] | ||
pub use cli_stub::CLIDashboardRenderer; |
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
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