-
Notifications
You must be signed in to change notification settings - Fork 597
Open
Description
In sparse_hmm.py, in the unpack_edges function, the initialization of self.ends is dangerous as they are no guarantee that all states will be linked to ending Silence(). So, some values may not be initialized, leading to NaN in my case (prefix-tree implementation with SparseHMM).
https://github.com/jmschrei/pomegranate/blob/master/pomegranate/hmm/sparse_hmm.py#L63
Proposed fix:
Replacing:
self.ends = torch.empty(n, dtype=self.dtype, device=self.device) - inf
by:
self.ends = torch.full((n, ), fill_value=-inf, dtype=self.dtype, device=self.device)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels