diff --git a/demo/aggregator_chain/index.html b/demo/aggregator_chain/index.html index b67d11d..9e3bcfc 100644 --- a/demo/aggregator_chain/index.html +++ b/demo/aggregator_chain/index.html @@ -54,6 +54,8 @@ + +

链式聚合流程(每参与方一段向量)

@@ -76,6 +78,13 @@ const $ = (s) => document.querySelector(s); $('#load').onclick = () => { $('#n').value = 3; $('#d').value = 4; $('#clip_c').value = 2.0; $('#zero_t').value = 10.0; $('#sigma').value = 0.5; + $('#load-info').innerHTML = + `📦 已加载示例配置 · ` + + `${$('#n').value} 个参与方 · ` + + `每方 ${$('#d').value} 维向量 · ` + + `链路:Clipping(C=${$('#clip_c').value}) → Zeroing(>${$('#zero_t').value}) → SecureSum → Mean(÷N=${$('#n').value}) → GaussianNoise(σ=${$('#sigma').value}) · ` + + `15% 概率生成大值触发裁剪/清零 · 点击「▶ 跑聚合链」真跑 nax.ml.aggregators.build_chain`; + $('#load-info').style.display = ''; toast('已加载示例'); }; diff --git a/demo/dp_primitives/index.html b/demo/dp_primitives/index.html index 7459882..4a3962c 100644 --- a/demo/dp_primitives/index.html +++ b/demo/dp_primitives/index.html @@ -62,6 +62,8 @@ table th, table td { padding: 6px 10px; border-bottom: 1px solid var(--border);
+ +

DP 流程:裁剪 → 加噪 → 隐私账本

@@ -114,6 +116,16 @@ const $ = (s) => document.querySelector(s); $('#load').onclick = () => { $('#n').value = 200; $('#clip_c').value = 5; $('#sigma').value = 1.0; $('#q').value = 0.5; $('#steps').value = 10; $('#mech').value = 'gaussian'; + $('#load-info').innerHTML = + `📦 已加载示例配置 · ` + + `n=${$('#n').value} 条记录 · ` + + `裁剪 C=${$('#clip_c').value} · ` + + `σ=${$('#sigma').value} · ` + + `采样率 q=${$('#q').value} · ` + + `机制=${$('#mech').value === 'gaussian' ? '高斯 (ε,δ)-DP' : '拉普拉斯 ε-DP'} · ` + + `连发 ${$('#steps').value} 次 · ` + + `点击「▶ 跑 DP 释放」真跑 nax.privacy.dp 的 clip_l2 → gaussian_noise/laplace_noise → GaussianAccountant`; + $('#load-info').style.display = ''; toast('已加载示例'); }; diff --git a/demo/secure_metrics/index.html b/demo/secure_metrics/index.html index e059f66..b2322e8 100644 --- a/demo/secure_metrics/index.html +++ b/demo/secure_metrics/index.html @@ -54,6 +54,8 @@ table th, table td { padding: 6px 10px; border-bottom: 1px solid var(--border);
+ +

密文评估结果(reveal to Alice)

@@ -99,6 +101,15 @@ const $ = (s) => document.querySelector(s); $('#load').onclick = () => { $('#n').value = 50; $('#quality').value = 'good'; + const qMap = { good: '好(ACC>0.8)', med: '中(~0.7)', bad: '差(~0.55)' }; + const noiseMap = { good: 0.15, med: 0.30, bad: 0.45 }; + $('#load-info').innerHTML = + `📦 已加载示例配置 · ` + + `n=${$('#n').value} 条样本 · ` + + `质量=${qMap[$('#quality').value]} · ` + + `噪声 σ=${noiseMap[$('#quality').value]} · ` + + `正例占比~50% · 点击「▶ 跑密文评估」后端会随机生成 n 条 y_true/y_prob 并真跑 nax.ml.metrics`; + $('#load-info').style.display = ''; toast('已加载:模型评估示例'); }; diff --git a/demo/secure_stats/index.html b/demo/secure_stats/index.html index 293fe95..2be1372 100644 --- a/demo/secure_stats/index.html +++ b/demo/secure_stats/index.html @@ -53,6 +53,8 @@
+ +

密文均值 / 方差 / 皮尔逊

@@ -107,6 +109,13 @@ const $ = (s) => document.querySelector(s); $('#load').onclick = () => { $('#n').value = 20; $('#r').value = 0.85; + $('#load-info').innerHTML = + `📦 已加载示例配置 · ` + + `n=${$('#n').value} 对 (Alice 年龄 + Bob 保费) · ` + + `真实相关系数 r=${$('#r').value} · ` + + `年龄分布 20-70 岁,保费 ≈ ${$('#r').value} × (年龄-45) × 200 + 噪声 · ` + + `点击「▶ 跑密文统计」真跑 nax.data.stats 算 secure_mean/var/pearson/correlation_matrix`; + $('#load-info').style.display = ''; toast('已加载:医院年龄 vs 保险保费示例'); };