ResidualCodec
- class lightning_ir.retrieve.plaid.residual_codec.ResidualCodec(index_config: PlaidIndexConfig, centroids: torch.Tensor, bucket_cutoffs: torch.Tensor, bucket_weights: torch.Tensor, verbose: bool = False)[source]
Bases:
object
- __init__(index_config: PlaidIndexConfig, centroids: torch.Tensor, bucket_cutoffs: torch.Tensor, bucket_weights: torch.Tensor, verbose: bool = False) None [source]
Methods
__init__
(index_config, centroids, ...[, verbose])binarize
(residuals)compress
(embeddings)compress_into_codes
(embeddings)decompress
(codes, compressed_residuals)from_pretrained
(index_config, index_dir)save
(index_dir)train
(index_config, train_embeddings[, verbose])try_load_torch_extensions
(use_gpu)Attributes
dim
num_centroids