分布式表示与卷积神经网络技术解析
1. 分布式表示相关内容
1.1 GloVe 算法核心计算
GloVe 算法在训练过程中有一系列核心的计算步骤。首先是梯度的计算,主要包括主词和上下文词的梯度以及偏置的梯度计算:
grad_main = weight * cost_inner * v_context
grad_context = weight * cost_inner * v_main
grad_bias_main = weight * cost_inner
grad_bias_context = weight * cost_inner
接着是参数的更新,使用学习率和梯度来更新主词向量、上下文词向量以及它们的偏置:
v_main -= (learning_rate * grad_main / np.sqrt(gradsq_W_main))
v_context -= (learning_rate * grad_context / np.sqrt(gradsq_W_context))
b_main -= (learning_rate * grad_bias_main / np.sqrt(gradsq_b_main))
b_context -= (learning_rate * grad_bias_context / np.sqrt(gradsq_b_context))
同时,还需要更新梯度平方和:
GloVe与CNN在NLP中的应用
超级会员免费看
订阅专栏 解锁全文
1951

被折叠的 条评论
为什么被折叠?



