All Projects → bcaine → learned_indices

bcaine / learned_indices

Licence: MIT License
A C++11 implementation of the B-Tree part of "The Case for Learned Index Structures"

Programming Languages

C++
36643 projects - #6 most used programming language
Jupyter Notebook
11667 projects
CMake
9771 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to learned indices

eigen-js
⚡ Eigen-js is a port of the Eigen C++ linear algebra library
Stars: ✭ 78 (+14.71%)
Mutual labels:  eigen
SANET
"Arbitrary Style Transfer with Style-Attentional Networks" (CVPR 2019)
Stars: ✭ 21 (-69.12%)
Mutual labels:  deep-learning-algorithms
surface splatting
OpenGL demo of a point rendering and texture filtering technique called Surface Splatting.
Stars: ✭ 125 (+83.82%)
Mutual labels:  eigen
SimplexSolver
An easy-to-use Simplex solver class for linear programming.
Stars: ✭ 18 (-73.53%)
Mutual labels:  eigen
RcppEigen
Rcpp integration for the Eigen templated linear algebra library
Stars: ✭ 89 (+30.88%)
Mutual labels:  eigen
sia-cog
Various cognitive api for machine learning, vision, language intent alalysis. Covers traditional as well as deep learning model design and training.
Stars: ✭ 34 (-50%)
Mutual labels:  deep-learning-algorithms
Mathtoolbox
Mathematical tools (interpolation, dimensionality reduction, optimization, etc.) written in C++11 with Eigen
Stars: ✭ 172 (+152.94%)
Mutual labels:  eigen
Deep-Learning
Study and implementation about deep learning models, architectures, applications and frameworks
Stars: ✭ 80 (+17.65%)
Mutual labels:  deep-learning-algorithms
sparsezoo
Neural network model repository for highly sparse and sparse-quantized models with matching sparsification recipes
Stars: ✭ 264 (+288.24%)
Mutual labels:  deep-learning-algorithms
GA SLAM
🚀 SLAM for autonomous planetary rovers with global localization
Stars: ✭ 40 (-41.18%)
Mutual labels:  eigen
dtt
A C++ header-only for data transfer between linear algebra libraries (Eigen, Armadillo, OpenCV, ArrayFire, LibTorch).
Stars: ✭ 74 (+8.82%)
Mutual labels:  eigen
osqp-cpp
A C++ interface for the OSQP quadratic programming solver.
Stars: ✭ 160 (+135.29%)
Mutual labels:  eigen
NumpyDL
Deep Learning Library. For education. Based on pure Numpy. Support CNN, RNN, LSTM, GRU etc.
Stars: ✭ 206 (+202.94%)
Mutual labels:  deep-learning-algorithms
eigen
Owl's OCaml Interface to Eigen3 C++ Library
Stars: ✭ 30 (-55.88%)
Mutual labels:  eigen
h5pp
A C++17 interface for HDF5
Stars: ✭ 60 (-11.76%)
Mutual labels:  eigen
Dive Into Ml System
Dive into machine learning system, start from reinventing the wheel.
Stars: ✭ 220 (+223.53%)
Mutual labels:  eigen
matio-cpp
A C++ wrapper of the matio library, with memory ownership handling, to read and write .mat files.
Stars: ✭ 24 (-64.71%)
Mutual labels:  eigen
ign-math
General purpose math library for robot applications.
Stars: ✭ 35 (-48.53%)
Mutual labels:  eigen
datascience-mashup
In this repo I will try to gather all of the projects related to data science with clean datasets and high accuracy models to solve real world problems.
Stars: ✭ 36 (-47.06%)
Mutual labels:  deep-learning-algorithms
URT
Fast Unit Root Tests and OLS regression in C++ with wrappers for R and Python
Stars: ✭ 70 (+2.94%)
Mutual labels:  eigen

A C++11 implementation of the B-Tree part of "The Case for Learned Index Structures"

A research proof of concept that implements the B-Tree section of The Case for Learned Index Structures paper in C++.

The general design is to have a single lookup structure that you can parameterize with a KeyType and a ValueType, and an overflow list that keeps new inserts until you retrain. There is a value in the constructor of the RMI that triggers a retrain when the overflow array reaches a certain size.

The basic API:

// [first/second]StageParams are network parameters
int maxAllowedError = 256;
int maxBufferBeforeRetrain = 10001;
auto modelIndex = RecursiveModelIndex<int, int, 128> recursiveModelIndex(firstStageParams, 
                                                                         secondStageParams, 
                                                                         maxAllowedError, 
                                                                         maxBufferBeforeRetrain);

for (int ii = 0; ii < 10000; ++ii) {
    modelIndex.insert(ii, ii * 2);
}

// Since we still have one more insert before retraining, retrain before searching...
modelIndex.train();
 
auto result = modelIndex.find(5);
 
if (result) {
    std::cout << "Yay! We got: " << result.get().first << ", " << result.get().second << std::endl;
} else {
    std::cout << "Value not found." << std::endl; // This shouldn't happen in the above usage...
}

See src/main.cpp for a usage example where it stores scaled log normal data.

Dependencies

  • nn_cpp - Eigen based minimalistic C++ Neural Network library
  • cpp-btree - A fast C++ implementation of a B+ Tree

TODO:

  • Lots of code cleanup
  • Profiling of where the slowdowns are. On small tests, the cpp_btree lib beats it by 10-100x
    • Eigen::TensorFixed in nn_cpp would definitely help
    • Increasing dataset size may lead to more of an advantage to the RMI
    • Being much, much more efficient with memory and conversions (lots of casting)
  • Very non-linear data the second stage tends to break down or stop performing on.
  • A non-trivial amount of our second stage "dies" in the sense that we don't use it for predictions.
    • The larger the dataset, or the more second stage nodes, the more likely this is. Bug somewhere?
  • Experimenting/tuning of training parameters
    • Still more learning rate sensitive than I'd like
  • Checking, and failing if there are non-integer keys
  • Tests on the actual RMI code (instead of using tests for experiments)
  • Move retrain to non-blocking thread
  • Logging
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].