Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
labmlai
GitHub Repository: labmlai/annotated_deep_learning_paper_implementations
Path: blob/master/translate_cache/sampling/top_k.zh.json
4928 views
1
{
2
"<h1>Top-k Sampling</h1>\n<p>Here we first pick the top-k tokens from the distribution of logits, and then sample from them.</p>\n<p>Here&#x27;s an <a href=\"experiment.html\">experiment</a> that uses these sampling techniques.</p>\n": "<h1>\u524d k \u4e2a\u91c7\u6837</h1>\n<p>\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u9996\u5148\u4ecelogits\u5206\u5e03\u4e2d\u6311\u9009top-k\u4ee3\u5e01\uff0c\u7136\u540e\u4ece\u4e2d\u91c7\u6837\u3002</p>\n<p>\u8fd9\u662f\u4e00\u4e2a\u4f7f\u7528\u8fd9\u4e9b\u91c7\u6837\u6280\u672f\u7684<a href=\"experiment.html\">\u5b9e\u9a8c</a>\u3002</p>\n",
3
"<h2>Top-k Sampler</h2>\n": "<h2>Top-k \u91c7\u6837\u5668</h2>\n",
4
"<p> Sample from logits</p>\n": "<p>\u6765\u81ea logits \u7684\u6837\u672c</p>\n",
5
"<p>New logits filled with <span translate=no>_^_0_^_</span>; i.e. zero probability </p>\n": "<p>\u65b0\u7684 logit \u586b\u5145\u4e86<span translate=no>_^_0_^_</span>\uff1b\u5373\u96f6\u6982\u7387</p>\n",
6
"<p>Pick the largest <span translate=no>_^_0_^_</span> logits and their indices </p>\n": "<p>\u9009\u62e9\u6700\u5927\u7684\u5bf9<span translate=no>_^_0_^_</span>\u6570\u53ca\u5176\u6307\u6570</p>\n",
7
"<p>Sample from the top-k logits with the specified sampler. </p>\n": "<p>\u4f7f\u7528\u6307\u5b9a\u91c7\u6837\u5668\u4ece top-k logits \u4e2d\u62bd\u6837\u3002</p>\n",
8
"<p>Set the values of the top-k selected indices to actual logits. Logits of other tokens remain <span translate=no>_^_0_^_</span> </p>\n": "<p>\u5c06\u9009\u5b9a\u524d k \u4e2a\u7d22\u5f15\u7684\u503c\u8bbe\u7f6e\u4e3a\u5b9e\u9645\u5bf9\u6570\u3002\u5176\u4ed6\u4ee3\u5e01\u7684\u8bb0\u5f55\u4ecd\u7136\u5b58\u5728<span translate=no>_^_0_^_</span></p>\n",
9
"<ul><li><span translate=no>_^_0_^_</span> is the number of tokens to pick </li>\n<li><span translate=no>_^_1_^_</span> is the sampler to use for the top-k tokens</li></ul>\n<p><span translate=no>_^_2_^_</span> can be any sampler that takes a logits tensor as input and returns a token tensor; e.g. <a href=\"temperature.html\">`TemperatureSampler&#x27;</a>.</p>\n": "<ul><li><span translate=no>_^_0_^_</span>\u662f\u8981\u6311\u9009\u7684\u4ee3\u5e01\u6570\u91cf</li>\n<li><span translate=no>_^_1_^_</span>\u662f\u7528\u4e8e\u524d k \u4e2a\u4ee3\u5e01\u7684\u91c7\u6837\u5668</li></ul>\n<p><span translate=no>_^_2_^_</span>\u53ef\u4ee5\u662f\u4efb\u4f55\u4ee5 logits \u5f20\u91cf\u4f5c\u4e3a\u8f93\u5165\u5e76\u8fd4\u56de\u4ee4\u724c\u5f20\u91cf\u7684\u91c7\u6837\u5668\uff1b\u4f8b\u5982 <a href=\"temperature.html\">\u201cTemperatureSample\u201d</a>\u3002</p>\n",
10
"A PyTorch implementation of top-k sampling from language models.": "\u6765\u81ea\u8bed\u8a00\u6a21\u578b\u7684 top-k \u91c7\u6837\u7684 PyTorch \u5b9e\u73b0\u3002",
11
"Top-k Sampling": "\u524d k \u4e2a\u91c7\u6837"
12
}
13