You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Helper function to define a `knncolle::LoadPrebuiltFunction` for Annoy in `knncolle::load_prebuilt()`.
63
63
*
64
64
* To load an Annoy index from disk, users are expected to define and register an Annoy-specific `knncolle::LoadPrebuiltFunction`.
65
-
* In this function, users should first call `load_annoy_prebuilt_types()` to figure out the saved index's `AnnoyDistance_`, `AnnoyIndex` and `AnnoyData_`.
65
+
* In this function, users should call `load_annoy_prebuilt_types()` to figure out the saved index's `AnnoyDistance_`, `AnnoyIndex` and `AnnoyData_`.
66
66
* Then, they should call `load_annoy_prebuilt()` with the appropriate types to return a pointer to a `knncolle::Prebuilt` object.
67
67
* This user-defined function should be registered in `load_prebuilt_registry()` with the key in `knncolle_annoy::save_name`.
68
68
*
69
69
* We do not define a default function for loading Annoy indices as there are too many possible combinations of types.
70
70
* Instead, the user is responsible for deciding which combinations of types should be handled.
71
-
* This avoids binary bloat from repeated instantiations of the Annoy template classes, if an application only deals with a certain subset of combinations.
72
-
* For types or distances that are unknown to `knncolle::get_numeric_type()` or `get_distance_name()`, respectively,
73
-
* users can store additional information on disk via `customize_save_for_annoy_types()` for use in loading.
71
+
* This avoids binary bloat from repeated instantiations of the Annoy template classes, if the user's application only deals with a certain subset of combinations.
72
+
*
73
+
* For unknown types or distances, users can set `custom_save_for_annoy_index()`, `custom_save_for_annoy_data()` and/or `custom_save_for_annoy_distance()`.
74
+
* Each custom function saves additional information about its type to disk during a `knncolle::Prebuilt::save()` call.
75
+
* That information can then be parsed in the user-defined `knncolle::LoadPrebuiltFunction` to recover an Annoy index with the appropriate template types.
74
76
*
75
77
* @tparam Index_ Integer type for the observation indices.
76
78
* @tparam Data_ Numeric type for the input and query data.
0 commit comments