neuroprob/likelihoods.py
def onehot_to_counts(self, onehot):
        """
        Convert one-hot vector representation of counts. Assumes the event dimension is the last.
        
        :param torch.tensor onehot: one-hot vector representation of shape (..., event)
        :returns: spike counts
        :rtype: torch.tensor
        """
        counts = torch.zeros(*onehot.shape[:-1], device=onehot.device)
        inds = torch.where(onehot)
        counts[inds[:-1]] = inds[-1].float()
        return counts

        Convert one-hot vector representation of counts. Assumes the event dimension is the last.
        
        :param torch.tensor onehot: one-hot vector representation of shape (..., event)
        :returns: spike counts
        :rtype: torch.tensor
        
Convert one-hot vector representation of counts. Assumes the event dimension is the last.
Convert one - hot vector representation of counts . Assumes the event dimension is the last .
def onehot_to_counts(self, onehot):
        counts = torch.zeros(*onehot.shape[:-1], device=onehot.device)
        inds = torch.where(onehot)
        counts[inds[:-1]] = inds[-1].float()
        return counts
def onehot_to_counts ( self , onehot ) : counts = torch . zeros ( * onehot . shape [ : - 1 ] , device = onehot . device ) inds = torch . where ( onehot ) counts [ inds [ : - 1 ] ] = inds [ - 1 ] . float ( ) return counts
Convert one-hot vector representation of counts.
Convert one - hot vector representation of counts .
"""
        Convert one-hot vector representation of counts. Assumes the event dimension is the last.
        
        :param torch.tensor onehot: one-hot vector representation of shape (..., event)
        :returns: spike counts
        :rtype: torch.tensor
        """
None
torch.tensor
self
onehot
one-hot vector representation of shape (..., event)
one - hot vector representation of shape ( ... event )