class CSVDataset[source]

CSVDataset(root:str, name:str, train:bool=True, size:int=-1, download:bool=True, verbose:bool=True, dtype:dtype=torch.float32, pde_solver:dl4to.pde.PDESolver=None, solve_pde_for_trivial_solution:bool=False, solve_pde_for_gt_solution:bool=False) :: TopoDataset

A class for downloading, generating and importing datasets from CSV files. An inheriting class needs to override the method _get_gz_file_paths_dict for correct paths to the .tar.gz files that contain the csv files (see e.g. SELTO datasets).

Type Default Details
root str The root directory in which the datasets should be downloaded, generated and accessed.
name str The name of the dataset that should be downloaded.
train bool True Whether the training or validation dataset should be generated.
size int -1 The size of the dataset. If size=-1, then the whole dataset is imported. Useful if only subsets of the original dataset are needed.
download bool True Whether the dataset should be downloaded, if needed.
verbose bool True Whether to give the user feedback on the progress.
dtype dtype torch.float32 The datatype into which the values from the csv files are converted.
pde_solver dl4to.pde.PDESolver None The PDE solver that is used to solve the PDE for linear elasticity. Only has an effect if either solve_pde_for_trivial_solution=True or solve_pde_for_gt_solution=True.
solve_pde_for_trivial_solution bool False Whether to solve the PDE for each trivial solution and save the displacements in the solution object. These can later be accessed via problem.trivial_solution.u. This is useful if PDE preprocessing is used. Requires a PDE solver.
solve_pde_for_gt_solution bool False Whether to solve the PDE for each ground truth and save the displacements in the solution object. These can later be accessed via gt_solution.u. Requires a PDE solver.