peal.sparse_dictionaries.activation_cache.cache_path

peal.sparse_dictionaries.activation_cache.cache_path(generator, data_config)[source]

Path of the cache file for this generator/dataset combination.

The file name is acts_<sha1[:16]>.pt under <generator.config.base_path>/activation_cache; the digest covers the encoder fingerprint and every data_config field that changes which images are encoded or how they are preprocessed.

Parameters:
  • generator (InvertibleGenerator) – Generator whose encoder produces the activations; only its config is inspected.

  • data_config (DataConfig) – Dataset configuration; missing fields count as None in the key.

Returns:

Absolute or base-path-relative path of the .pt cache file.

Return type:

str