xnn.hybnn.models.spookynet.SpookyNetPlanner#
- class xnn.hybnn.models.spookynet.SpookyNetPlanner(local_cutoff, lr_cutoff, long_range, ewald)[source]#
Bases:
objectThe index work of a SpookyNet step, done before the step for captured steps.
A captured step (
xnn.common.train.graphed) needs fixed shapes and no host synchronization. SpookyNet selects its local edges and its long-range pairs by distance, and pads the attention to the largest structure: each reads values back from the device. A data-loader worker builds them on the CPU instead:"local"(the edges within the local cutoff),"lr"(the edges withinlr_cutoff) or"lr_dst"and"lr_src"(all ordered pairs of every structure, withoutlr_cutoff), and"slot"(each atom’s position in its structure, which gives the sizen_maxof the attention).SpookyNet.forward()takes them from the batch’sindex_plan. The Ewald sum is not supported. Holds only the model’s cutoffs.- Parameters:
local_cutoff (float) – The cutoff of the local interactions.
lr_cutoff (float or None) – The cutoff of the long-range terms (
None: all pairs).long_range (bool) – Whether the model has electrostatics or dispersion.
ewald (bool) – Whether the model sums the electrostatics of periodic structures by Ewald.
- maxima = ('n_max',)#
Plan sizes that are the largest over the structures rather than sums.
- offsets: Dict[str, str | None]#
The count each plan entry indexes (for batching the plans of single structures).