Skip to content

Commit

Permalink
Format and change QRD level to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
mhovd committed Nov 27, 2023
1 parent 1800d4f commit db67c35
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 32 deletions.
18 changes: 9 additions & 9 deletions examples/bimodal_ke/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ impl<'a> Predict<'a> for Ode {
type State = State;
fn initial_system(&self, params: &Vec<f64>, scenario: Scenario) -> (Self::Model, Scenario) {
let params = HashMap::from([("ke".to_string(), params[0]), ("v".to_string(), params[1])]);
(Model {
params,
_scenario: scenario.clone(),//TODO remove
infusions: vec![],
cov: None,
},
scenario.reorder_with_lag(vec![(0.0, 1)])
)

(
Model {
params,
_scenario: scenario.clone(), //TODO remove
infusions: vec![],
cov: None,
},
scenario.reorder_with_lag(vec![(0.0, 1)]),
)
}
fn get_output(&self, x: &Self::State, system: &Self::Model, outeq: usize) -> f64 {
let v = system.get_param("v");
Expand Down
8 changes: 4 additions & 4 deletions src/algorithms/npag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use crate::{
simulation::predict::Engine,
simulation::predict::{sim_obs, Predict},
},
tui::ui::Comm, routines::expansion::adaptative_grid::adaptative_grid,

routines::expansion::adaptative_grid::adaptative_grid,
tui::ui::Comm,
};

use ndarray::{Array, Array1, Array2, Axis};
Expand Down Expand Up @@ -199,7 +199,7 @@ where
pub fn run(&mut self) -> NPResult {
while self.eps > THETA_E {
// Enter a span for each cycle, provding context for further errors
let cycle_span = tracing::span!(tracing::Level::INFO, "Cycle", cycle = self.cycle);
let cycle_span = tracing::span!(tracing::Level::INFO, "Cycle", cycle = self.cycle);
let _enter = cycle_span.enter();

// psi n_sub rows, nspp columns
Expand Down Expand Up @@ -280,7 +280,7 @@ where

// Increasing objf signals instability or model misspecification.
if self.last_objf > self.objf {
tracing::error!(
tracing::debug!(
"Objective function decreased from {} to {}",
self.last_objf,
self.objf
Expand Down
35 changes: 19 additions & 16 deletions src/algorithms/npod.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
use crate::{prelude::{
algorithms::Algorithm,
condensation::prune::prune,
datafile::Scenario,
evaluation::sigma::{ErrorPoly, ErrorType},
ipm,
optimization::d_optimizer::SppOptimizer,
output::NPResult,
output::{CycleLog, NPCycle},
prob, qr,
settings::run::Data,
simulation::predict::Engine,
simulation::predict::{sim_obs, Predict},
}, tui::ui::Comm};
use crate::{
prelude::{
algorithms::Algorithm,
condensation::prune::prune,
datafile::Scenario,
evaluation::sigma::{ErrorPoly, ErrorType},
ipm,
optimization::d_optimizer::SppOptimizer,
output::NPResult,
output::{CycleLog, NPCycle},
prob, qr,
settings::run::Data,
simulation::predict::Engine,
simulation::predict::{sim_obs, Predict},
},
tui::ui::Comm,
};
use ndarray::parallel::prelude::*;
use ndarray::{Array, Array1, Array2, Axis};
use ndarray_stats::{DeviationExt, QuantileExt};
Expand Down Expand Up @@ -292,8 +295,8 @@ where
prune(&mut self.theta, cp, &self.ranges, THETA_D);
}

// Stop if we have reached maximum number of cycles
if self.cycle >= self.settings.parsed.config.cycles {
// Stop if we have reached maximum number of cycles
if self.cycle >= self.settings.parsed.config.cycles {
tracing::warn!("Maximum number of cycles reached");
break;
}
Expand Down
4 changes: 1 addition & 3 deletions src/routines/optimization/d_optimizer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use argmin::{
core::{
CostFunction, Error, Executor,
},
core::{CostFunction, Error, Executor},
solver::neldermead::NelderMead,
};
use ndarray::{Array1, Axis};
Expand Down

0 comments on commit db67c35

Please sign in to comment.