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

Function train_then_encode_roundtrip

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

Source from the content-addressed store, hash-verified

280
281 #[test]
282 fn train_then_encode_roundtrip() {
283 let codec = trained();
284 let v = det_vec(0, DIM);
285 let enc = codec.encode(&v).expect("encode");
286 let prep = codec.prepare_query(&v).expect("prepare_query");
287 let dist = codec.distance_prepared(&prep, &enc).expect("distance");
288 assert!(dist.is_finite(), "distance must be finite, got {dist}");
289 assert!(dist >= 0.0, "distance must be non-negative, got {dist}");
290 }
291
292 #[test]
293 fn encode_before_train_returns_not_trained() {

Callers

nothing calls this directly

Calls 6

trainedFunction · 0.70
det_vecFunction · 0.70
expectMethod · 0.45
encodeMethod · 0.45
prepare_queryMethod · 0.45
distance_preparedMethod · 0.45

Tested by

no test coverage detected