This repository contains the implementation code for AMDEN (Amorphous Material DEnoising Network), a diffusion model framework for inverse design of amorphous materials.
The codebase is organized into three main directories:
-
src/- Source code implementationmain.py- Main entry point for training and inferencepipeline.py- Training, testing, and inference pipelinesdata.py- Dataset loading and preprocessing utilitiesmodels/- Neural network architecturesdenoisers/- Denoising model implementations (EGNN-based)networks/- Core network architecturesmodules/- Supporting modules (noise schedules, losses)
utils.py- Utility functions and loggingneighborlists.py- Neighbor list computation for molecular systems
-
runtime/- Environment setup options (5 different methods)- Docker, Singularity, Poetry, Nix Flake, and pip-based setups
-
settings/- Configuration files organized by material systema-si/- Amorphous silicon configurationsa-sio2/- Amorphous silica configurationsmeg/- Multi-element glass configurations
Datasets can be found under datasets/:
flake- Nix Flake with a development environment to run the scripts for analyzing the datasetsMEG/- Multi-element glass datasetdata/- Structure and property dataworkflow/- LAMMPS and Python scripts used for generating the datasetsrc/- Script to compute the Young's modulus shown in the paper
Si- Amorphous Silicondata/- Structure datasrc/- Script to compute the sheer modulus and average ring size shown in the paper
SiO2- Three variants of amorphous Silica with different cooling schedules (melt, quench, anneal)data/- Structure and property datasrc/- Script to compute radial distribution functions, bond angle distributions, structure factors and potential energies
Choose one of the following setup methods based on your environment:
cd runtime/
docker build -t amden .
docker run --gpus all -it -v $(pwd)/..:/workspace amdencd runtime/poetry/
poetry install
poetry shellcd runtime/flake/
# With CUDA support
nix develop .#withCuda
# Without CUDA
nix develop .#withoutCudacd runtime/
singularity build amden.sif ddm.def
singularity shell --nv amden.sifcd runtime/
bash init.sh
source $HOME/venv/bin/activateThe main entry point accepts the following arguments:
python src/main.py -s <settings_file> -g <gpu_id> [--compile]-s, --setting: Path to YAML/JSON configuration file (required)-g, --cuda: GPU device index (default: 0, use -1 for CPU)--compile: Enable PyTorch model compilation for performance
Configuration files are organized by material system and experiment type. Each config file contains:
model: Architecture and model parametersscheduler: Noise schedule parameters for diffusion processloss: Loss function configurationtrain: Training parameters and data settingsinfer: Inference parameters and output settingsload: Model checkpoint loading settings
Training a model:
python src/main.py -s settings/meg/egnn-E/train.yaml -g 0Running inference:
python src/main.py -s settings/meg/egnn-E/infer.yaml -g 0The implementation supports:
- ExtXYZ files: Atomic structure data with extended properties
- JSON property files: Material properties for conditioning
- LAMMPS data files: Alternative input format (via ASE)
Expected file structure for datasets:
datasets/
├── material_name/
│ ├── structures.extxyz
│ └── properties.json