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
@DelightRun
DelightRun / cloudSettings
Last active April 29, 2020 08:23
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-04-29T08:23:10.533Z","extensionVersion":"v3.4.3"}
"""
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.
@DelightRun
DelightRun / build.py
Created January 18, 2019 17:17
Python Scripts for Accurate KNN Graph Construction using FAISS and GPU
import time
import argparse
import faiss
import numpy as np
from utils import load_vecs, save_vecs
parser = argparse.ArgumentParser(description="Build KNN Graph using GPU")
parser.add_argument('dataset', type=str, help='Dataset')
parser.add_argument('k', type=int, nargs='+', help='K')
@DelightRun
DelightRun / ppa-mirror.sh
Created January 4, 2019 12:40
Replace PPA source with USTC mirror
sudo find /etc/apt/sources.list.d/ -type f -name "*.list" -exec sed -i.bak -r 's#deb(-src)?\s*http(s)?://ppa.launchpad.net#deb\1 http\2://launchpad.proxy.ustclug.org#ig' {} \;