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
<divclass="ttc" id="aclassknncolle__annoy_1_1AnnoyBuilder_html"><divclass="ttname"><ahref="classknncolle__annoy_1_1AnnoyBuilder.html">knncolle_annoy::AnnoyBuilder</a></div><divclass="ttdoc">Perform an approximate nearest neighbor search with Annoy.</div><divclass="ttdef"><b>Definition</b> Annoy.hpp:403</div></div>
117
+
<divclass="ttc" id="aclassknncolle__annoy_1_1AnnoyBuilder_html"><divclass="ttname"><ahref="classknncolle__annoy_1_1AnnoyBuilder.html">knncolle_annoy::AnnoyBuilder</a></div><divclass="ttdoc">Perform an approximate nearest neighbor search with Annoy.</div><divclass="ttdef"><b>Definition</b> Annoy.hpp:408</div></div>
118
118
<divclass="ttc" id="aknncolle__annoy_8hpp_html"><divclass="ttname"><ahref="knncolle__annoy_8hpp.html">knncolle_annoy.hpp</a></div><divclass="ttdoc">Approximate nearest neighbor search with Annoy.</div></div>
119
119
<divclass="ttc" id="anamespaceknncolle_html_a2c6d8b116464bab254bda34216338c3c"><divclass="ttname"><ahref="https://knncolle.github.io/knncolle/namespaceknncolle.html#a2c6d8b116464bab254bda34216338c3c">knncolle::find_nearest_neighbors</a></div><divclass="ttdeci">NeighborList< Index_, Distance_ > find_nearest_neighbors(const Prebuilt< Index_, Data_, Distance_ > &index, int k, int num_threads=1)</div></div>
120
120
</div><!-- fragment --><p>Check out the <ahref="https://knncolle.github.io/knncolle_annoy/">reference documentation</a> for more details.</p>
<divclass="ttc" id="aclassknncolle__annoy_1_1AnnoyBuilder_html_a45abac40b562d4aa23e89b0eae298dd0"><divclass="ttname"><ahref="classknncolle__annoy_1_1AnnoyBuilder.html#a45abac40b562d4aa23e89b0eae298dd0">knncolle_annoy::AnnoyBuilder::get_options</a></div><divclass="ttdeci">AnnoyOptions & get_options()</div><divclass="ttdef"><b>Definition</b> Annoy.hpp:422</div></div>
134
+
<divclass="ttc" id="aclassknncolle__annoy_1_1AnnoyBuilder_html_a45abac40b562d4aa23e89b0eae298dd0"><divclass="ttname"><ahref="classknncolle__annoy_1_1AnnoyBuilder.html#a45abac40b562d4aa23e89b0eae298dd0">knncolle_annoy::AnnoyBuilder::get_options</a></div><divclass="ttdeci">AnnoyOptions & get_options()</div><divclass="ttdef"><b>Definition</b> Annoy.hpp:427</div></div>
135
135
</div><!-- fragment --><p>Advanced users can configure the template parameters to use more suitable types for their applications. A hypothetical configuration is shown below with (mostly made up) reasons:</p>
</div><!-- fragment --><p>Then we can save and reload the <code>Prebuilt</code> Annoy indices. Note the caveats on <code><aclass="elRef" href="https://knncolle.github.io/knncolle/classknncolle_1_1Prebuilt.html#a87930f878bf3a22297b851173caaf893">knncolle::Prebuilt::save()</a></code> - specifically, the files are not guaranteed to be portable between machines or even different versions of <b><aclass="el" href="namespaceknncolle__annoy.html" title="Approximate nearest neighbor search with Annoy.">knncolle_annoy</a></b>.</p>
<p>Define a customized saving function to preserve type information from the Annoy index in <code><aclass="elRef" href="https://knncolle.github.io/knncolle/classknncolle_1_1Prebuilt.html#a87930f878bf3a22297b851173caaf893">knncolle::Prebuilt::save()</a></code>. Users can provide their own function here, to handle types that are unknown to <code><aclass="el" href="#a5a77303e4f9434ddc0218aa14b19f1fb">get_numeric_type()</a></code> or <code><aclass="el" href="#a0f46fd7ab22d7976baec00c98c038bea">get_distance_name()</a></code>. Any modifications to this function are not thread-safe and should be done in a serial section.</p>
<tr><tdclass="paramname">AnnoyDistance_</td><td>An <b>Annoy</b>-compatible class to compute the distance between vectors. </td></tr>
212
+
<tr><tdclass="paramname">AnnoyIndex_</td><td>Integer type for the observation indices in the Annoy index. </td></tr>
213
+
<tr><tdclass="paramname">AnnoyData_</td><td>Floating-point type for data in the Annoy index.</td></tr>
214
+
</table>
215
+
</dd>
216
+
</dl>
217
+
<dlclass="section return"><dt>Returns</dt><dd>A global function for saving information about <code>AnnoyDistance_</code>, <code>AnnoyIndex_</code> and <code>AnnoyData_</code>. If set, this will be called by the <code><aclass="elRef" href="https://knncolle.github.io/knncolle/classknncolle_1_1Prebuilt.html#a87930f878bf3a22297b851173caaf893">knncolle::Prebuilt::save()</a></code> method for the Annoy <code>Prebuilt</code> subclass. </dd></dl>
<dlclass="section return"><dt>Returns</dt><dd>Name of the distance metric, e.g., <code>"euclidean"</code>, <code>"manhattan"</code>. This is taken from <code>AnnoyDistance_::name()</code> if such a method exists, otherwise <code>"unknown"</code> is returned. </dd></dl>
243
+
<dlclass="section return"><dt>Returns</dt><dd>Name of the distance metric, e.g., <code>"euclidean"</code>, <code>"manhattan"</code>. This is taken from <code>AnnoyDistance_::name()</code> if such a method exists, otherwise <code>"unknown"</code> is returned.</dd></dl>
244
+
<p>For unknown distances, consider using <code><aclass="el" href="#a46b2125811a26fae459c4c54803be3ae">customize_save_for_annoy_types()</a></code> to add more information to the on-disk representation during a <code><aclass="elRef" href="https://knncolle.github.io/knncolle/classknncolle_1_1Prebuilt.html#a87930f878bf3a22297b851173caaf893">knncolle::Prebuilt::save()</a></code> call. </p>
<dlclass="section return"><dt>Returns</dt><dd>Identity of the numeric type. </dd></dl>
270
+
<dlclass="section return"><dt>Returns</dt><dd>Identity of the numeric type.</dd></dl>
271
+
<p>For unknown types, consider using <code><aclass="el" href="#a46b2125811a26fae459c4c54803be3ae">customize_save_for_annoy_types()</a></code> to add more information to the on-disk representation during a <code><aclass="elRef" href="https://knncolle.github.io/knncolle/classknncolle_1_1Prebuilt.html#a87930f878bf3a22297b851173caaf893">knncolle::Prebuilt::save()</a></code> call. </p>
0 commit comments