Repository structure
June 10, 2023 ยท View on GitHub
This repository has a modular structure, where you can have multiple implementations for each module and switch between them by changing the configuration file.
We use OmegaConf to manage the configuration files. Please, see OmegaConf documentation for more details.
The configuration files are stored in the configs/ directory.
Each of them has configurations for four main modules of the pipeline:
datasetis a module for data loading and preprocessing.datasetmodules are stored indatasets/directory. Eachdatasetmodule defines aDatasetclass.modelis a module where a GNN model is defined.modelmodules are stored in themodels/directory. Eachmodelmodule defines aModelclass which inherits fromtorch.nn.Module.- The
Modelobjects create an input graph, pass it through the GNN and returns the predicted accelerations. - The GNN architecture is defined in the
core_modelmodule. These are stored in themodels/core_models/directory. Eachcore_modelmodule defines anEncodeProcessDecodeclass.
- The
runnermodule defines the training and validation loops.runnermodules are stored in therunners/directory. Each runner module definesRunnerclass which defines:valid_rollout()method used to generate a sequence of garment geometries for validationforward()method used in training. It runs a forward pass of the model and performs an optimization step.
create_optimizer()function that builds an optimizer and a scheduler for the training processrun_epoch()which iterates over the dataloader and calls runner.forward() for each training sample
criterionsare modules that define the objective terms. One configuration file may have an unlimited number of criterions, their values are summed up.criterionmodules are stored in thecriterions/directory. Each criterion module defines aCriterionclass which inherits fromtorch.nn.Module.

Each module also defines a Config class which declares the parameters of the module. Their value may be overridden in the configuration file on in the command line (see OmegaConf documentation).

Pytorch Geometric for handling graphs
We use Pytorch Geometric to handle the graph data and run message-passing steps.
For details, please, see Pytorch Geometric documentation and datasets/README.md.