From 453b49fc19e2fa42e5a228f9f43759a8ed2da613 Mon Sep 17 00:00:00 2001 From: "pasquale c." <343guiltyspark@outlook.it> Date: Tue, 15 Oct 2024 19:07:37 +0200 Subject: [PATCH] fix --- src/direct_mlj.jl | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/direct_mlj.jl b/src/direct_mlj.jl index 15d3b39..fb366f0 100644 --- a/src/direct_mlj.jl +++ b/src/direct_mlj.jl @@ -239,14 +239,20 @@ function MMI.update(m::Laplace_Models, verbosity, old_fitresult, old_cache, X, y fitresult = (la, y[1]) report = (loss_history=old_loss_history,) - cache = (deepcopy(m), old_state_tree, old_loss_history) + cache = old_cache else - nothing + fitresult = old_fitresult + report = (loss_history=old_loss_history,) + cache = (deepcopy(m), old_state_tree, old_loss_history) end - end + + + - if MMI.is_same_except( + return fitresult, cache, report + + elseif MMI.is_same_except( m, old_model, :fit_prior_nsteps, @@ -282,9 +288,23 @@ function MMI.update(m::Laplace_Models, verbosity, old_fitresult, old_cache, X, y fitresult = la report = (loss_history=old_loss_history,) cache = (deepcopy(m), old_state_tree, old_loss_history) + + return fitresult, cache, report + + + + else + + fitresult, cache, report = MMI.fit(m, verbosity, X, y) + + + return fitresult, cache, report + + + + end - return fitresult, cache, report end @doc """