Skip to content

Commit

Permalink
report -2ll instead of ll
Browse files Browse the repository at this point in the history
  • Loading branch information
Siel committed Jan 17, 2024
1 parent 18b6d66 commit b6524f5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/bimodal_ke/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cycles = 1024
engine = "NPAG"
init_points = 10000
seed = 347
tui = false
tui = true
pmetrics_outputs = true
cache = true
idelta = 0.1
Expand Down
7 changes: 3 additions & 4 deletions src/algorithms/npag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ where
self.theta.clone(),
self.psi.clone(),
self.w.clone(),
self.objf,
-2. * self.objf,
self.cycle,
self.converged,
self.settings.clone(),
Expand Down Expand Up @@ -277,6 +277,8 @@ where
gamlam: self.gamma,
};
self.tx.send(Comm::NPCycle(state.clone())).unwrap();
self.cycle_log
.push_and_write(state, self.settings.parsed.config.pmetrics_outputs.unwrap());

// Increasing objf signals instability or model misspecification.
if self.last_objf > self.objf {
Expand All @@ -290,9 +292,6 @@ where
self.w = self.lambda.clone();
let pyl = self.psi.dot(&self.w);

self.cycle_log
.push_and_write(state, self.settings.parsed.config.pmetrics_outputs.unwrap());

// Stop if we have reached convergence criteria
if (self.last_objf - self.objf).abs() <= THETA_G && self.eps > THETA_E {
self.eps /= 2.;
Expand Down
2 changes: 1 addition & 1 deletion src/routines/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ impl CycleWriter {

pub fn write(&mut self, cycle: usize, objf: f64, gamma: f64, theta: &Array2<f64>) {
self.writer.write_field(format!("{}", cycle)).unwrap();
self.writer.write_field(format!("{}", -2. * objf)).unwrap();
self.writer.write_field(format!("{}", objf)).unwrap();
self.writer.write_field(format!("{}", gamma)).unwrap();
self.writer
.write_field(format!("{}", theta.nrows()))
Expand Down

0 comments on commit b6524f5

Please sign in to comment.