def mean_sdf(self): """ Returns an SDF of the mean surface Params: none Returns: SDF: mean surface """ return sdf.Sdf2D(self.mean_pred_.reshape(self.dims_))
def _read_2d(self): ''' Reads a 2d SDF from a CSV file ''' if not os.path.exists(self.file_name_): raise IOError('File does not exist') sdf_data = np.loadtxt(self.file_name_, delimiter=',') return sdf.Sdf2D(sdf_data)
def _read_2d(self): """Reads in a 2D SDF file and returns a Sdf object. Returns ------- :obj:`Sdf2D` A 2DSdf created from the data in the file. """ if not os.path.exists(self.filepath_): return None sdf_data = np.loadtxt(self.filepath_, delimiter=',') return sdf.Sdf2D(sdf_data)
def sample_sdfs(self, num_samples=1, full_cov=True): """ Samples sdfs from the GPIS Params: num_samples: (int) number of samples to generate full_cov: (bool) whether or not to use the diagonal or entire covariance matrix Returns: list of sdf objects """ sdf_samples = self.gp_.posterior_samples(self.grid_pts_, num_samples) sdfs = [] for i in range(num_samples): sdf_data = sdf_samples[:,i].reshape(self.dims_) sdfs.append(sdf.Sdf2D(sdf_data, pose = self.pose_)) return sdfs