Closed fohrloop closed 2 days ago
Fixes: https://github.com/lucasmaystre/choix/issues/25
Alternative would be to disallow z reaching zero. Like this:
def hessian(self, params): hess = 2 * self._penalty * np.identity(len(params)) for win, los in self._data: z = _safe_exp(params[win] - params[los]) or math.exp(-500) # this changed val = 1 / (1/z + 2 + z) hess[(win,los),(los,win)] += -val hess[(win,los),(win,los)] += +val return hess
Let me know what you think.
I like your suggested fix to _safe_exp, will merge. Thanks!
_safe_exp
Fixes: https://github.com/lucasmaystre/choix/issues/25
Alternative would be to disallow z reaching zero. Like this:
Let me know what you think.