Batch Utility: Masks

Batch Utility: Masks#

Functions for creating masks that discern between padding and actual values.

tad_mctc.batch.mask.triples.real_triples(numbers, mask_diagonal=True, mask_self=True)[source]#

Create a mask for triples from atomic numbers. Padding value is zero.

Parameters:
  • numbers (Tensor) – Atomic numbers for all atoms.

  • mask_diagonal (bool, optional) – Flag for also masking the diagonal, i.e., all pairs with the same indices. Defaults to True, i.e., writing False to the diagonal.

  • mask_self (bool, optional) – Flag for also masking all triples where at least two indices are identical. Defaults to True, i.e., writing False.

Returns:

Mask for triples.

Return type:

Tensor