Loading peak_integration.py +8 −1 Original line number Diff line number Diff line Loading @@ -1321,9 +1321,16 @@ class Loss(object): class MLELoss(Loss): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # usefull constant to make optimal loss closer to 0 # it can affect relative convergence criteria pos_data = self.data[self.data>0] self.constant = -(pos_data-pos_data*np.log(pos_data)).sum() def loss(self, params): fit = self.fit(params) return (fit-self.data*np.log(fit)).sum() return (fit-self.data*np.log(fit)).sum() + self.constant @property def dloss_dfit(self): Loading Loading
peak_integration.py +8 −1 Original line number Diff line number Diff line Loading @@ -1321,9 +1321,16 @@ class Loss(object): class MLELoss(Loss): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # usefull constant to make optimal loss closer to 0 # it can affect relative convergence criteria pos_data = self.data[self.data>0] self.constant = -(pos_data-pos_data*np.log(pos_data)).sum() def loss(self, params): fit = self.fit(params) return (fit-self.data*np.log(fit)).sum() return (fit-self.data*np.log(fit)).sum() + self.constant @property def dloss_dfit(self): Loading