Parameters
Parameter | Type | Default | Description |
---|---|---|---|
n_lists | int | 0 | (Optional) Number of inverted index lists to create in the index. If 0 , it will auto-determine based on the number of vectors in the index. |
batch_size | int | 2048 | (Optional) Size of each batch for training. |
max_iters | int | 100 | (Optional) Maximum number of iterations for training. |
tolerance | float | 1e-6 | (Optional) Convergence tolerance for training. |
max_memory | int | 0 | (Optional) Maximum memory to use for training. 0 sets no limit. |
There must be at least
2 * n_lists
or 10,000
(whichever is greater) vector embeddings in the index prior to to calling this function.Exceptions
ValueError
ValueError
- Raises an exception if the index was not created or loaded yet.
RuntimeError
RuntimeError
- Raises an exception if there are not enough vector embeddings in the index for training (must be at least
2 * n_lists
). - Raises an exception if the index could not be trained.