Skip to content

Commit

Permalink
Hacky bypass to avoid vanishing scale
Browse files Browse the repository at this point in the history
  • Loading branch information
nspope committed Dec 5, 2024
1 parent b0e1126 commit 1791b09
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tsdate/variational.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,12 @@ def twin_projection(x, y):
factors[:, ROOTWARD] *= scale[edges_parent, np.newaxis]
factors[:, LEAFWARD] *= scale[edges_child, np.newaxis]
scale[:] = 1.0
# /FIXME
# FIXME: this is a hacky bypass
if scale[p] < TINY or scale[c] < TINY: # DEBUG
factors[:, ROOTWARD] *= scale[edges_parent, np.newaxis]
factors[:, LEAFWARD] *= scale[edges_child, np.newaxis]
scale[:] = 1.0
factors[:, ROOTWARD] *= scale[edges_parent, np.newaxis]
factors[:, LEAFWARD] *= scale[edges_child, np.newaxis]
scale[:] = 1.0
# /FIXME

@staticmethod
@numba.njit(_void(_b1r, _f2w, _f3w, _f1w, _f, _i, _f))
Expand Down

0 comments on commit 1791b09

Please sign in to comment.