listwise.py 文件源码

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

项目:shoelace 作者: rjagerman 项目源码 文件源码
def _pl_sample(t, ?):
    """
    Sample from the plackett luce distribution directly

    :param t: The target labels 
    :return: A random permutation from the plackett-luce distribution
             parameterized by the target labels
    """
    xp = cuda.get_array_module(t)
    t = t[:, 0]

    probs = xp.exp(t * ?)
    probs /= xp.sum(probs)
    return xp.random.choice(probs.shape[0], probs.shape[0], replace=False,
                            p=probs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号