title.py 文件源码

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

项目:reddit-iambic-pentameter 作者: pmichel31415 项目源码 文件源码
def sample_noun(self, vector):
        """Sample a noun at random.
        The probability of word :math:`w` is
        .. math::
            \log(p(w))\propto w^Tv`

        where :math:`p` is the poem vector and :math:`w` the word vector"""
        p = util.softmax(self.noun_vectors.dot(vector) / self.tau)
        return npr.choice(self.nouns, p=p)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号