importance_sampling.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:alpha-dimt-icmlws 作者: sotetsuk 项目源码 文件源码
def uniform_weights(n_sample):
    """Return uniform weights (almost for debug).

    EXAMPLE
    -------
    >>> weights = uniform_weights(3)
    >>> print(weights)
    <BLANKLINE>
     0.3333
     0.3333
     0.3333
    [torch.FloatTensor of size 3]
    <BLANKLINE>

    :return:
    """
    weights = torch.ones(n_sample)
    return weights / weights.sum()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号