摘要:概述 在NLP中,对于一个词,我们用一个词向量来表示,最常见的一个方式是one hot representation,这种词向量的编码方式就是用一个很长的向量来表示一个词,向量的长度为词典的大小N,向量的分量只有一个1,其他全为0,1的位置对应该词在词典中的索引。这种表示方法不需要繁琐的计算,简单易
阅读全文
摘要:函数定义 Tensor.expand_as(other) → Tensor Expand this tensor to the same size as other. self.expand_as(other) is equivalent to self.expand(other.size()).
阅读全文
摘要:函数定义 Tensor.expand(*sizes) → Tensor Returns a new view of the self tensor with singleton(一个,单个) dimensions expanded to a larger size. Passing -1 as th
阅读全文
摘要:机器学习中有很多巧妙的窍门, 可以加速训练 提升表现 ... 今天我将讨论LogSumExp这一机器学习中常见的模式。 定义 首先给出定义: 我们什么时候会见到这样的式子?常见的一个地方是计算softmax函数的交叉熵损失。softmax函数可以见下式所示: 你可以把softmax函数看成一种接受任
阅读全文
摘要:前言 对于命名实体识别任务,基于神经网络的方法非常普遍。例如,Neural Architectures for Named Entity Recognition提出了一个使用word and character embeddings的BiLSTM-CRF命名实体识别模型。我将以本文中的模型为例来解释
阅读全文