muffled_utils.py 文件源码

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

项目:marvin 作者: aikanor 项目源码 文件源码
def calc_specialist_weights(numsamps):
    """
    Calculates vector of specialist weights.
    Args:
        numsamps: A nonnegative vector of ints, specifying the number of samples on which each specialist predicts.
    Returns:
        A vector of floats specifying each specialist's weight (1/(fraction of data supported)). 
        If numsamps[i] == 0 for some specialist i, the corresponding weight will be 0. 

    Note that the return value is invariant to the scaling of numsamps by a positive constant. 
    Similarly, calculating numsamps using a uniform random subsample of a dataset 
    will result in approximately the same return value as using the full dataset.
    """
    weights = 1.0/numsamps
    weights[np.isinf(weights)] = 0.0
    return np.max(numsamps)*weights
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号