neuroprob/likelihoods.py
def sample(self, rate, neuron=None, XZ=None):
        """
        Sample spike trains from the modulated renewal process.
        
        :param numpy.array rate: input rate of shape (trials, neuron, timestep)
        :returns: spike train of shape (trials, neuron, timesteps)
        :rtype: np.array
        """
        neuron = self._validate_neuron(neuron)
        spiketimes = point_process.gen_IRP(self.ISI_dist(neuron), rate[:, neuron, :], self.tbin.item())
            
        tr_t_spike = []
        for sp in spiketimes:
            tr_t_spike.append(self.ind_to_train(torch.tensor(sp), rate.shape[-1]).numpy())

        return np.array(tr_t_spike).reshape(rate.shape[0], -1, rate.shape[-1])

        Sample spike trains from the modulated renewal process.
        
        :param numpy.array rate: input rate of shape (trials, neuron, timestep)
        :returns: spike train of shape (trials, neuron, timesteps)
        :rtype: np.array
        
Sample spike trains from the modulated renewal process.
Sample spike trains from the modulated renewal process .
def sample(self, rate, neuron=None, XZ=None):
        neuron = self._validate_neuron(neuron)
        spiketimes = point_process.gen_IRP(self.ISI_dist(neuron), rate[:, neuron, :], self.tbin.item())
        tr_t_spike = []
        for sp in spiketimes:
            tr_t_spike.append(self.ind_to_train(torch.tensor(sp), rate.shape[-1]).numpy())
        return np.array(tr_t_spike).reshape(rate.shape[0], -1, rate.shape[-1])
def sample ( self , rate , neuron = None , XZ = None ) : neuron = self . _validate_neuron ( neuron ) spiketimes = point_process . gen_IRP ( self . ISI_dist ( neuron ) , rate [ : , neuron , : ] , self . tbin . item ( ) ) tr_t_spike = [ ] for sp in spiketimes : tr_t_spike . append ( self . ind_to_train ( torch . tensor ( sp ) , rate . shape [ - 1 ] ) . numpy ( ) ) return np . array ( tr_t_spike ) . reshape ( rate . shape [ 0 ] , - 1 , rate . shape [ - 1 ] )
Sample spike trains from the modulated renewal process.
Sample spike trains from the modulated renewal process .
"""
        Sample spike trains from the modulated renewal process.
        
        :param numpy.array rate: input rate of shape (trials, neuron, timestep)
        :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
rate
input rate of shape (trials, neuron, timestep)
input rate of shape ( trials neuron timestep )
neuron
XZ