xnn.common.finetune.replay.select_replay#

xnn.common.finetune.replay.select_replay(structures, species=None, n=None, mode='subset', seed=0)[source]#

Assemble a replay set: element filter, then a random subsample.

Parameters:
  • structures (iterable of dict) – Candidate structures (the pretraining data, or any diverse set).

  • species (iterable of int, optional) – The fine-tuning elements; None applies no element filter.

  • n (int, optional) – Number of structures to keep (a seeded random choice); None keeps all that pass the filter.

  • mode (str, optional) – The element filter (REPLAY_FILTERS), by default "subset".

  • seed (int, optional) – Seed of the subsample.

Returns:

The selected structures (the original dicts).

Return type:

list of dict