TorchRef Documentation
A PyTorch-based crystallographic refinement library
TorchRef is a crystallographic refinement package built entirely on PyTorch. Autograd and GPU acceleration make it composable with machine-learning workflows and cheap to extend with new targets, restraints, and optimizers.
It is mainly a library to build and experiment with, not a replacement for mainline refinement programs on standard problems.
Key Features
Native PyTorch Integration: built on
nn.ModuleAutomatic Differentiation: define a forward pass, get gradients
Modular Architecture: composable targets, restraints, optimizers
GPU Acceleration: CUDA and Apple Silicon (MPS)
Checkpointing:
save_state/load_stateresume a refinement rebuilt from the same input files
Getting Started
User Guide
API Reference
Development