Skip to content

Instantly share code, notes, and snippets.

View DelightRun's full-sized avatar

Wang Changxu DelightRun

  • Alibaba
  • Beijing, China
View GitHub Profile
@DelightRun
DelightRun / l2sqr_functions.cpp
Created September 2, 2021 09:19 — forked from matsui528/l2sqr_functions.cpp
Runtime evaluation for squared Euclidean distances with SSE, AVX, AVX512 implementations
#include <iostream>
#include <random>
#include <chrono>
#include <x86intrin.h>
#include <cassert>
// Runtime evaluation for squared Eucliden distance functions
// - fvec_L2_sqr_ref: naive reference impl from Faiss
// - fvec_L2_sqr_sse: SSE impl from Faiss
// - fvec_L2_sqr_avx: AVX impl from Faiss
"""
Implementation of 'Maximum Likelihood Estimation of Intrinsic Dimension' by Elizaveta Levina and Peter J. Bickel
how to use
----------
The goal is to estimate intrinsic dimensionality of data, the estimation of dimensionality is scale dependent
(depending on how much you zoom into the data distribution you can find different dimesionality), so they
propose to average it over different scales, the interval of the scales [k1, k2] are the only parameters of the algorithm.