proof-of-portfolio 0.0.105__py3-none-any.whl → 0.0.106__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- proof_of_portfolio/_version.py +1 -1
- proof_of_portfolio/circuits/components/src/core/omega.nr +19 -15
- proof_of_portfolio/circuits/target/circuits.json +1 -1
- proof_of_portfolio/circuits/vk/vk +0 -0
- {proof_of_portfolio-0.0.105.dist-info → proof_of_portfolio-0.0.106.dist-info}/METADATA +1 -1
- {proof_of_portfolio-0.0.105.dist-info → proof_of_portfolio-0.0.106.dist-info}/RECORD +9 -9
- {proof_of_portfolio-0.0.105.dist-info → proof_of_portfolio-0.0.106.dist-info}/WHEEL +0 -0
- {proof_of_portfolio-0.0.105.dist-info → proof_of_portfolio-0.0.106.dist-info}/entry_points.txt +0 -0
- {proof_of_portfolio-0.0.105.dist-info → proof_of_portfolio-0.0.106.dist-info}/top_level.txt +0 -0
proof_of_portfolio/_version.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
# This file is auto-generated during build
|
2
|
-
__version__ = "0.0.
|
2
|
+
__version__ = "0.0.106"
|
@@ -47,24 +47,28 @@ pub fn omega(
|
|
47
47
|
omega_loss_min
|
48
48
|
};
|
49
49
|
|
50
|
-
// Apply cross-multiplication with scaling
|
51
|
-
//
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
let
|
57
|
-
let
|
58
|
-
|
59
|
-
let
|
60
|
-
|
50
|
+
// Apply PTN cross-multiplication with overflow-safe scaling
|
51
|
+
// positive_sum = product_sum_positive * sum_weights_negative
|
52
|
+
// negative_sum = product_sum_negative * sum_weights_positive
|
53
|
+
// final = (positive_sum * RATIO_SCALE_FACTOR) / max(abs(negative_sum), omega_loss_min)
|
54
|
+
|
55
|
+
// To avoid overflow, we can rearrange: (a*b*c)/d = (a*c)*(b/d) when b > d
|
56
|
+
let positive_cross = product_sum_positive * sum_weights_negative;
|
57
|
+
let negative_cross = product_sum_negative * sum_weights_positive;
|
58
|
+
|
59
|
+
let abs_negative = if negative_cross >= 0 { negative_cross } else { -negative_cross };
|
60
|
+
let effective_denominator = if abs_negative >= omega_loss_min {
|
61
|
+
abs_negative
|
61
62
|
} else {
|
62
|
-
omega_loss_min
|
63
|
+
omega_loss_min
|
63
64
|
};
|
64
65
|
|
65
|
-
//
|
66
|
-
|
67
|
-
|
66
|
+
// Avoid overflow by doing division first when possible
|
67
|
+
if effective_denominator >= RATIO_SCALE_FACTOR {
|
68
|
+
positive_cross / (effective_denominator / RATIO_SCALE_FACTOR)
|
69
|
+
} else {
|
70
|
+
(positive_cross / effective_denominator) * RATIO_SCALE_FACTOR
|
71
|
+
}
|
68
72
|
} else {
|
69
73
|
let mut positive_sum: i64 = 0;
|
70
74
|
let mut negative_sum: i64 = 0;
|