targets.py 文件源码

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

项目:sef 作者: passalis 项目源码 文件源码
def sim_target_fixed(target_data, target_labels, sigma, idx, target_params):
    """
    Sets as target to have fixed similarity between all the training samples
    :param target_data: (not used)
    :param target_labels: (not used)
    :param sigma: not used
    :param idx: indices of the data samples to be used for the calculation of the similarity matrix
    :param target_params: expect to found the 'target_value' here
    :return: the similarity matrix and the corresponding mask
    """
    if 'target_value' not in target_params:
        target_params['target_value'] = 0.0

    Gt = np.ones((len(idx), len(idx)))
    Gt = Gt * target_params['target_value']
    Gt_mask = np.ones_like(Gt)

    return np.float32(Gt), np.float32(Gt_mask)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号