[lab4] Missed hidden layer size input
This commit is contained in:
parent
6f2ab2bb6b
commit
d20a7e6bd5
@ -36,6 +36,7 @@ enum TrainingState {
|
|||||||
struct MyApp {
|
struct MyApp {
|
||||||
model: ComparationOperatorsModel<7, 7, 8>,
|
model: ComparationOperatorsModel<7, 7, 8>,
|
||||||
training: TrainingState,
|
training: TrainingState,
|
||||||
|
hidden_layer_size: usize,
|
||||||
n: f64,
|
n: f64,
|
||||||
epochs_count: usize,
|
epochs_count: usize,
|
||||||
symbols: [&'static str; 8],
|
symbols: [&'static str; 8],
|
||||||
@ -48,6 +49,7 @@ impl Default for MyApp {
|
|||||||
return Self {
|
return Self {
|
||||||
model: ComparationOperatorsModel::new(imgs.1),
|
model: ComparationOperatorsModel::new(imgs.1),
|
||||||
training: TrainingState::NoTrain,
|
training: TrainingState::NoTrain,
|
||||||
|
hidden_layer_size: 1,
|
||||||
n: 0.1,
|
n: 0.1,
|
||||||
epochs_count: 1,
|
epochs_count: 1,
|
||||||
symbols: imgs.0,
|
symbols: imgs.0,
|
||||||
@ -78,6 +80,11 @@ impl eframe::App for MyApp {
|
|||||||
fn update(&mut self, ui: &eframe::egui::Context, _frame: &mut eframe::Frame) {
|
fn update(&mut self, ui: &eframe::egui::Context, _frame: &mut eframe::Frame) {
|
||||||
egui::CentralPanel::default().show(ui, |ui| {
|
egui::CentralPanel::default().show(ui, |ui| {
|
||||||
ui.add_enabled_ui(matches!(self.training, TrainingState::NoTrain), |ui| {
|
ui.add_enabled_ui(matches!(self.training, TrainingState::NoTrain), |ui| {
|
||||||
|
_slider(ui, "Hidden layer size", &mut self.hidden_layer_size, 1..=49, 1f64);
|
||||||
|
if (self.hidden_layer_size != self.model.hidden_layer_size()) {
|
||||||
|
self.model.resize_hidden_layer(self.hidden_layer_size);
|
||||||
|
}
|
||||||
|
ui.label("");
|
||||||
_slider(ui, "η", &mut self.n, 0.0..=1.0, 0.001);
|
_slider(ui, "η", &mut self.n, 0.0..=1.0, 0.001);
|
||||||
ui.label("");
|
ui.label("");
|
||||||
_slider(ui, "Epochs count", &mut self.epochs_count, 1..=500, 1f64);
|
_slider(ui, "Epochs count", &mut self.epochs_count, 1..=500, 1f64);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user