neuroprob/base.py
def to_XZ(self, covariates, trials=1):
        """
        Convert covariates list input to tensors for input to mapping. Convenience function for rate 
        evaluation functions and sampling functions.
        """
        cov_list = []
        timesteps = None
        for cov_ in covariates:
            if len(cov_.shape) == 1: # expand arrays from (timesteps,)
                cov_ = cov_[None, :, None]
            elif len(cov_.shape) == 2: # expand arrays (timesteps, dims)
                cov_ = cov_[None, ...]
            if len(cov_.shape) != 3:
                raise ValueError('Covariates are of invalid shape')

            if timesteps is not None:
                if timesteps != cov_.shape[1]:
                    raise ValueError('Time steps in covariates dimensions are not consistent')
            else:
                timesteps = cov_.shape[1]

            cov_list.append(torch.tensor(cov_, device=self.dummy.device,
                                         dtype=self.tensor_type))
        XZ = torch.cat(cov_list, dim=-1).expand(trials, timesteps, -1)
        return XZ

        Convert covariates list input to tensors for input to mapping. Convenience function for rate 
        evaluation functions and sampling functions.
        
Convert covariates list input to tensors for input to mapping. Convenience function for rate
evaluation functions and sampling functions.
Convert covariates list input to tensors for input to mapping . Convenience function for rate evaluation functions and sampling functions .
def to_XZ(self, covariates, trials=1):
        cov_list = []
        timesteps = None
        for cov_ in covariates:
            if len(cov_.shape) == 1: 
                cov_ = cov_[None, :, None]
            elif len(cov_.shape) == 2: 
                cov_ = cov_[None, ...]
            if len(cov_.shape) != 3:
                raise ValueError('Covariates are of invalid shape')
            if timesteps is not None:
                if timesteps != cov_.shape[1]:
                    raise ValueError('Time steps in covariates dimensions are not consistent')
            else:
                timesteps = cov_.shape[1]
            cov_list.append(torch.tensor(cov_, device=self.dummy.device,
                                         dtype=self.tensor_type))
        XZ = torch.cat(cov_list, dim=-1).expand(trials, timesteps, -1)
        return XZ
def to_XZ ( self , covariates , trials = 1 ) : cov_list = [ ] timesteps = None for cov_ in covariates : if len ( cov_ . shape ) == 1 : cov_ = cov_ [ None , : , None ] elif len ( cov_ . shape ) == 2 : cov_ = cov_ [ None , ... ] if len ( cov_ . shape ) != 3 : raise ValueError ( 'Covariates are of invalid shape' ) if timesteps is not None : if timesteps != cov_ . shape [ 1 ] : raise ValueError ( 'Time steps in covariates dimensions are not consistent' ) else : timesteps = cov_ . shape [ 1 ] cov_list . append ( torch . tensor ( cov_ , device = self . dummy . device , dtype = self . tensor_type ) ) XZ = torch . cat ( cov_list , dim = - 1 ) . expand ( trials , timesteps , - 1 ) return XZ
Convert covariates list input to tensors for input to mapping.
Convert covariates list input to tensors for input to mapping .
"""
        Convert covariates list input to tensors for input to mapping. Convenience function for rate 
        evaluation functions and sampling functions.
        """ # expand arrays from (timesteps,) # expand arrays (timesteps, dims)
self
covariates
trials