faiss 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d260b6585de456d0df620c322f5366a9ae29a1d275c0200c726233f5c5156aa
4
- data.tar.gz: 1f463792926335213ae59a56c7271593fa9eaf93d4705fa936da02d74127a571
3
+ metadata.gz: '02752578b25cfcc61a7bb0e06e1d0dbc2d78175796cf99a44184a4e7298de073'
4
+ data.tar.gz: ec678cf766efa90be0e013b342be6f95e42c6e67c4aa6de1b9e3b6f4c59d8699
5
5
  SHA512:
6
- metadata.gz: 70960a3c2244b8d8dceaa7a2cc98a04b8f765c783ff2d1879d61e2303f7a7337490b67a9a6a56d3f0a4e19939812418122394633f2a68c198a6e0776a3a2b29a
7
- data.tar.gz: 0bc2edfdc86a7d3894923dfd98fe6db7dfa8a15cf640340198f92f7ef967b9548ed7a18e80d886018d8f621da01f73c1b061a85cf892318327144209d1a4ed87
6
+ metadata.gz: 9342c736f6ce775b8561f0fc066b565e38f8d38470f98ea51b9635f371bb8efdbb9e049874588847fb11360da006da3ec0ca28d44fc6f844d970d91f648f1b03
7
+ data.tar.gz: e70f220fdc76a37fcf5a06beba2b07f0315bbbb3dab7b396a8f932c04746e11454bd57ed527d18d55436352bd823d1e33e341046697fd36b124f7e64fbb72f38
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.1.6 (2021-03-21)
2
+
3
+ - Added support for inner product to `IndexIVFFlat` and `IndexIVFPQ`
4
+ - Added `ParameterSpace`
5
+ - Added `nprobe=` method
6
+
1
7
  ## 0.1.5 (2021-03-14)
2
8
 
3
9
  - Added `--with-optflags` option
data/ext/faiss/index.cpp CHANGED
@@ -8,6 +8,7 @@
8
8
  #include <faiss/IndexIVFPQ.h>
9
9
  #include <faiss/IndexIVFPQR.h>
10
10
  #include <faiss/index_io.h>
11
+ #include <faiss/AutoTune.h>
11
12
 
12
13
  #include <rice/Array.hpp>
13
14
  #include <rice/Constructor.hpp>
@@ -75,6 +76,11 @@ void init_index(Rice::Module& m) {
75
76
  ret.push(lstr);
76
77
  return ret;
77
78
  })
79
+ .define_method(
80
+ "nprobe=",
81
+ *[](faiss::Index &self, double val) {
82
+ faiss::ParameterSpace().set_index_parameter(&self, "nprobe", val);
83
+ })
78
84
  .define_method(
79
85
  "save",
80
86
  *[](faiss::Index &self, const char *fname) {
@@ -96,7 +102,7 @@ void init_index(Rice::Module& m) {
96
102
  .define_constructor(Rice::Constructor<faiss::IndexHNSWFlat, int, int, faiss::MetricType>(), (Rice::Arg("d"), Rice::Arg("M"), Rice::Arg("metric") = faiss::METRIC_L2));
97
103
 
98
104
  Rice::define_class_under<faiss::IndexIVFFlat, faiss::Index>(m, "IndexIVFFlat")
99
- .define_constructor(Rice::Constructor<faiss::IndexIVFFlat, faiss::Index*, size_t, size_t>());
105
+ .define_constructor(Rice::Constructor<faiss::IndexIVFFlat, faiss::Index*, size_t, size_t, faiss::MetricType>(), (Rice::Arg("quantizer"), Rice::Arg("d"), Rice::Arg("nlist"), Rice::Arg("metric") = faiss::METRIC_L2));
100
106
 
101
107
  Rice::define_class_under<faiss::IndexLSH, faiss::Index>(m, "IndexLSH")
102
108
  .define_constructor(Rice::Constructor<faiss::IndexLSH, int64_t, int>());
@@ -111,8 +117,16 @@ void init_index(Rice::Module& m) {
111
117
  .define_constructor(Rice::Constructor<faiss::IndexIVFScalarQuantizer, faiss::Index*, size_t, size_t, faiss::ScalarQuantizer::QuantizerType>());
112
118
 
113
119
  Rice::define_class_under<faiss::IndexIVFPQ, faiss::Index>(m, "IndexIVFPQ")
114
- .define_constructor(Rice::Constructor<faiss::IndexIVFPQ, faiss::Index*, size_t, size_t, size_t, size_t>());
120
+ .define_constructor(Rice::Constructor<faiss::IndexIVFPQ, faiss::Index*, size_t, size_t, size_t, size_t, faiss::MetricType>(), (Rice::Arg("quantizer"), Rice::Arg("d"), Rice::Arg("nlist"), Rice::Arg("M"), Rice::Arg("nbits_per_idx"), Rice::Arg("metric") = faiss::METRIC_L2));
115
121
 
116
122
  Rice::define_class_under<faiss::IndexIVFPQR, faiss::Index>(m, "IndexIVFPQR")
117
123
  .define_constructor(Rice::Constructor<faiss::IndexIVFPQR, faiss::Index*, size_t, size_t, size_t, size_t, size_t, size_t>());
124
+
125
+ Rice::define_class_under<faiss::ParameterSpace>(m, "ParameterSpace")
126
+ .define_constructor(Rice::Constructor<faiss::ParameterSpace>())
127
+ .define_method(
128
+ "set_index_parameter",
129
+ *[](faiss::ParameterSpace& self, faiss::Index* index, const std::string& name, double val) {
130
+ self.set_index_parameter(index, name, val);
131
+ });
118
132
  }
data/lib/faiss/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Faiss
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faiss
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-15 00:00:00.000000000 Z
11
+ date: 2021-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rice