240 发简信
IP属地:新疆
  • hello, xlvector. I read your implementation, there is some parts I could not full understand. I am not sure whether you could give me more detailed descriptions for the codes below :

    class NceAuc(mx.metric.EvalMetric):
    def __init__(self):
    super(NceAuc, self).__init__('nce-auc')

    def update(self, labels, preds):
    label_weight = labels[1].asnumpy()
    preds = preds[0].asnumpy()
    tmp = []
    for i in range(preds.shape[0]):
    for j in range(preds.shape[1]):
    tmp.append((label_weight[i][j], preds[i][j]))
    tmp = sorted(tmp, key = itemgetter(1), reverse = True)
    m = 0.0
    n = 0.0
    z = 0.0
    k = 0
    for a, b in tmp:
    if a > 0.5:
    m += 1.0
    z += len(tmp) - k
    else:
    n += 1.0
    k += 1
    z -= m * (m + 1.0) / 2.0
    z /= m
    z /= n
    self.sum_metric += z
    self.num_inst += 1

    word2vec/lstm on mxnet with NCE loss

    Softmax是用来实现多类分类问题常见的损失函数。但如果类别特别多,softmax的效率就是个问题了。比如在word2vec里,每个词都是一个类别,在这种情况下可能有100...

  • Y君的求职历险记

    (纯属虚构,如有雷同,欢迎斗图) 这次要分享的故事的主人公暂且称其为Y君。 Y君基本情况: - 酷爱音乐、健身(跑得了马拉松,玩的转击剑)、交友(欢迎童颜美女勾搭) - 本...