MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / trained

Function trained

nodedb-vector/src/rerank/codecs/bbq.rs:273–279  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

271 }
272
273 fn trained() -> BbqRerank {
274 let vecs: Vec<Vec<f32>> = (0..N).map(|i| det_vec(i, DIM)).collect();
275 let refs: Vec<&[f32]> = vecs.iter().map(|v| v.as_slice()).collect();
276 let mut codec = BbqRerank::new(DIM, DEFAULT_OVERSAMPLE);
277 codec.train(&refs).expect("train must succeed");
278 codec
279 }
280
281 #[test]
282 fn train_then_encode_roundtrip() {

Calls 6

collectMethod · 0.80
det_vecFunction · 0.70
iterMethod · 0.45
as_sliceMethod · 0.45
expectMethod · 0.45
trainMethod · 0.45