Registry / Library

library · v0.1.0
WeightDrift
Find the largest per-asset deviation between two weight vectors.
Use WeightDrift
use vendor::weightdrift::weightdrift;
Run the example
nest demo weightdrift@0.1.0
blyxc native-run weightdrift-demo/main.blyx
Example source and expected output
use vendor::weightdrift::weightdrift;
fn main() {
let current = [0.75, 0.25];
let target = [0.5, 0.5];
let result = weightdrift_largest(current, target);
if len(result) == 0 { println!("invalid"); return; }
let mut i = 0;
while i < len(result) {
println!(at(result, i));
i += 1;
}
}
Expected output
0
0.25
0.25
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.0 | Download ZIP | 8ab90355b4 | 9ec2061d3a8aa5f8a99a3c8d99109f257af2e3fd99b5a61782a60543906fc405 |