torchref.refinement.targets.adp.locality module
- class torchref.refinement.targets.adp.locality.ADPLocalityTarget(model=None, k_neighbors=50, correlation_length=5.0, scale=5.0, exclude_bonded=True, verbose=0)[source]
Bases:
ADPTargetProximity-based ADP restraint using K nearest neighbors.
Uses a spatial cell-list (O(N) memory, O(N·k) time) instead of a full N×N distance matrix, so it scales to arbitrarily large structures without memory issues.
- Parameters:
model (Model) – Reference to Model object.
k_neighbors (int, optional) – Number of nearest neighbors to consider. Default is 50.
correlation_length (float, optional) – Distance scale for weight decay in Angstrom. Default is 5.0.
scale (float, optional) – Scaling factor for loss magnitude. Default is 5.0.
exclude_bonded (bool, optional) – Exclude directly bonded atoms. Default is True.
verbose (int, optional) – Verbosity level. Default is 0.
- __init__(model=None, k_neighbors=50, correlation_length=5.0, scale=5.0, exclude_bonded=True, verbose=0)[source]
Initialize model target.