neuroprob/likelihoods.py
def sample(self, rate, neuron=None, XZ=None):
        """
        Sample activity trains [trial, neuron, timestep]
        """
        neuron = self._validate_neuron(neuron)
        rate_ = rate[:, neuron, :]
        
        if self.log_var.shape[0] == 1:
            log_var = self.log_var.expand(1, len(neuron)).data[..., None].cpu().numpy()
        else:
            log_var = self.log_var.data[None, neuron, None].cpu().numpy()
        act = rate_ + np.exp(log_var/2.)*np.random.randn((rate.shape[0], len(neuron), rate.shape[-1])), rate_
        return act

        Sample activity trains [trial, neuron, timestep]
        
Sample activity trains [trial, neuron, timestep]
Sample activity trains [ trial neuron timestep ]
def sample(self, rate, neuron=None, XZ=None):
        neuron = self._validate_neuron(neuron)
        rate_ = rate[:, neuron, :]
        if self.log_var.shape[0] == 1:
            log_var = self.log_var.expand(1, len(neuron)).data[..., None].cpu().numpy()
        else:
            log_var = self.log_var.data[None, neuron, None].cpu().numpy()
        act = rate_ + np.exp(log_var/2.)*np.random.randn((rate.shape[0], len(neuron), rate.shape[-1])), rate_
        return act
def sample ( self , rate , neuron = None , XZ = None ) : neuron = self . _validate_neuron ( neuron ) rate_ = rate [ : , neuron , : ] if self . log_var . shape [ 0 ] == 1 : log_var = self . log_var . expand ( 1 , len ( neuron ) ) . data [ ... , None ] . cpu ( ) . numpy ( ) else : log_var = self . log_var . data [ None , neuron , None ] . cpu ( ) . numpy ( ) act = rate_ + np . exp ( log_var / 2. ) * np . random . randn ( ( rate . shape [ 0 ] , len ( neuron ) , rate . shape [ - 1 ] ) ) , rate_ return act
Sample activity trains [trial, neuron, timestep]
Sample activity trains [ trial neuron timestep ]
"""
        Sample activity trains [trial, neuron, timestep]
        """
self
rate
neuron
XZ