neuroprob/likelihoods.py
def sample(self, F_mu, neuron, XZ=None):
        """
        Sample from the categorical distribution.
        
        :param numpy.array log_probs: log count probabilities (trials, neuron, timestep, counts), no 
                                      need to be normalized
        :returns: spike train of shape (trials, neuron, timesteps)
        :rtype: np.array
        """
        F_dims = self._neuron_to_F(neuron)
        log_probs = self.get_logp(torch.tensor(F_mu[:, F_dims, :], dtype=self.tensor_type))
        c_dist = mdl.distributions.Categorical(logits=log_probs)
        cnt_prob = torch.exp(log_probs)
        return c_dist.sample().numpy()

        Sample from the categorical distribution.
        
        :param numpy.array log_probs: log count probabilities (trials, neuron, timestep, counts), no 
                                      need to be normalized
        :returns: spike train of shape (trials, neuron, timesteps)
        :rtype: np.array
        
Sample from the categorical distribution.
Sample from the categorical distribution .
def sample(self, F_mu, neuron, XZ=None):
        F_dims = self._neuron_to_F(neuron)
        log_probs = self.get_logp(torch.tensor(F_mu[:, F_dims, :], dtype=self.tensor_type))
        c_dist = mdl.distributions.Categorical(logits=log_probs)
        cnt_prob = torch.exp(log_probs)
        return c_dist.sample().numpy()
def sample ( self , F_mu , neuron , XZ = None ) : F_dims = self . _neuron_to_F ( neuron ) log_probs = self . get_logp ( torch . tensor ( F_mu [ : , F_dims , : ] , dtype = self . tensor_type ) ) c_dist = mdl . distributions . Categorical ( logits = log_probs ) cnt_prob = torch . exp ( log_probs ) return c_dist . sample ( ) . numpy ( )
Sample from the categorical distribution.
Sample from the categorical distribution .
"""
        Sample from the categorical distribution.
        
        :param numpy.array log_probs: log count probabilities (trials, neuron, timestep, counts), no 
                                      need to be normalized
        :returns: spike train of shape (trials, neuron, timesteps)
        :rtype: np.array
        """
spike train of shape (trials, neuron, timesteps)
spike train of shape ( trials neuron timesteps )
np.array
self
F_mu
neuron
XZ
log_probs
log count probabilities (trials, neuron, timestep, counts), no
need to be normalized
log count probabilities ( trials neuron timestep counts ) no need to be normalized