TransductiveExtractor#

class ts3.models.transductive.TransductiveExtractor(pretrain_ckpt, seed, ckpt_dir, filters=None, csv_path=None)[source]#

Bases: ts3.models.base.Extractor

property name: str#

Names the embeddings file, so two runs of one model do not overwrite each other.

property run_seed: int | None#

The seed of the run behind these embeddings, or None when no run produced them.

setup(data_root, device, logger)[source]#

Bind the run’s context. Override to load checkpoints once, not per regime.

Return type:

None

abstract read(state_dict, dataset, uids)[source]#

Embeddings for uids out of one checkpoint’s weights, and the uids they match.

Return type:

tuple[Tensor, ndarray]

encode(regime)[source]#

Embeddings and uids for every unit of regime this extractor can represent.

Returns (N, D) and (N,) in matching order. Units the extractor cannot represent may be omitted: the probe join drops anything TS3 does not score, and insists separately that the eval side is complete.

Return type:

tuple[Tensor, ndarray]