Comments (7)
Good to know! I'll leave this open in the event that we or someone else would be interested in making it part of the high level API.
from faiss-rs.
I'm afraid that the high-level bindings do not expose setting index parameters once the index was already constructed. I have managed to make do without this, apparently.
In the low-level API, the constructor function to the parameter space object is faiss_ParameterSpace_new
.
FaissParameterSpace* params = NULL;
int err = faiss_ParameterSpace_new(¶ms);
Nevertheless, if you'd like to try and extend the safe API with parameter space setting, please let me know, so I can then provide better guidance.
from faiss-rs.
I seem to have succeeded
let param = "nprobe".to_string();
let mut param_vec: Vec<*mut faiss_sys::FaissParameterSpace> = vec![std::ptr::null::<*mut faiss_sys::FaissParameterSpace>() as *mut _];
faiss_sys::faiss_ParameterSpace_new(param_vec.as_mut_ptr());
faiss_sys::faiss_ParameterSpace_set_index_parameter(*param_vec.as_mut_ptr(), self.inner_ptr(), param.as_ptr() as *const _, 2.0 );
let nprobe = faiss_sys::faiss_IndexIVF_nprobe(self.inner_ptr());
println!("{:?}", nprobe);
2
from faiss-rs.
Why is faiss_ParameterSpace_new required *mut *mut
?
https://github.com/Enet4/faiss-rs/blob/master/faiss-sys/src/bindings.rs#L263
from faiss-rs.
@ava57r The function
extern "C" {
pub fn faiss_ParameterSpace_new(space: *mut *mut FaissParameterSpace) -> ::std::os::raw::c_int;
Is the translation of the C function
int faiss_ParameterSpace_new(ParameterSpace** p_space);
Where to *p_space
is assigned the output of constructing a ParameterSpace
object via new
. Using it would be something like this:
let mut p_space = std::ptr::null_mut();
let e = faiss_ParameterSpace_new(&mut p_space);
from faiss-rs.
faiss_ParameterSpace_free
function exists only versions >= 1.6.4
fix free parameterspace (#1243)
from faiss-rs.
This seems to have been resolved by #14.
from faiss-rs.
Related Issues (20)
- Improve PreTransformIndex and update Clustering types HOT 1
- Macros to derive crate
- Support faiss_index_gpu_to_cpu in GpuIndexImpl HOT 2
- Use cxx for interop with Faiss HOT 1
- Slow training IVF indexes HOT 13
- Control over GPU <-> CPU result copies? HOT 1
- Memory leak detected. HOT 4
- Update C-API v1.7.2 HOT 1
- Save and reopen Index after train()? HOT 1
- read_index io flag support HOT 3
- Undefined symbols for architecture arm64
- panicked at 'too large index value provided to Idx::new' HOT 4
- Write Index into memory or Read Index from memory HOT 1
- Does this crate plan to support generic IO? HOT 1
- Can you also add support for static libraries? HOT 6
- Updating to latest faiss? HOT 9
- Support for mac m1? HOT 7
- Support binary indexes HOT 5
- confusing build linker error HOT 2
- `&mut self` argument on `index.search` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faiss-rs.