变密度采样
变密度采样:按兴趣函数在参数空间加密采样的支撑点生成器。
概述
quatm/utils/vds.py 提供**变密度采样(VDS)**工具:生成支撑点(采样点),随机分
布并在感兴趣区域按给定兴趣函数加密,用于优化有限的实验时间。
函数
| 函数 | 说明 |
|---|---|
create_support_points_stochastic(start, stop, steps, interest_fn, ...) | 生成随机分布且 ROI 加密的支撑点 |
gauss_prime_norm(x, mu, sigma) | 高斯函数导数的归一化形式(峰值归一为 1) |
gauss_prime_norm_abs(x, mu, sigma) | 高斯导数绝对值的归一化形式 |
用法
from quatm.utils.vds import create_support_points_stochastic
# interest_fn 返回权重(0-1),决定各处的采样密度
points = create_support_points_stochastic(
start=0, stop=100, steps=200,
interest_fn=lambda x: gauss_prime_norm_abs(x, mu=50, sigma=10),
)