INNER CODE UNIT · Python
after_fit
timeseriesAI/tsai · tsai/callback/core.py:147
def after_fit(self, **kwargs):
"Load the best model."
if self.at_end: self._save(f'{self.fname}')
elif not self.every_epoch: self.learn.load(f'{self.fname}', with_opt=self.with_opt)
# %% ../../nbs/024_callback.core.ipynb #c916484a
from scipy.ndimage import gaussian_filter1d
from scipy.signal.windows import triang
from scipy.ndimage import convolve1d
def get_lds_kernel_window(lds_kernel="gaussian", lds_ks=9, lds_sigma=1):
r"""Function to determine the label distribution smoothing kernel window
lds_kernel (str): LDS kernel type
lds_ks (int): LDS kernel size (should be an odd number).
lds_sigma (float): LDS gaussian/laplace kernel sigma
"""