-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
1,670 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,210 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html;charset=utf-8"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||
<meta name="description" content=""/> | ||
|
||
<meta name="twitter:card" content="summary"/> | ||
<meta name="twitter:image:src" content="https://avatars1.githubusercontent.com/u/64068543?s=400&v=4"/> | ||
<meta name="twitter:title" content="configs.py"/> | ||
<meta name="twitter:description" content=""/> | ||
<meta name="twitter:site" content="@labmlai"/> | ||
<meta name="twitter:creator" content="@labmlai"/> | ||
|
||
<meta property="og:url" content="https://nn.labml.ai/RWKV/configs.html"/> | ||
<meta property="og:title" content="configs.py"/> | ||
<meta property="og:image" content="https://avatars1.githubusercontent.com/u/64068543?s=400&v=4"/> | ||
<meta property="og:site_name" content="configs.py"/> | ||
<meta property="og:type" content="object"/> | ||
<meta property="og:title" content="configs.py"/> | ||
<meta property="og:description" content=""/> | ||
|
||
<title>configs.py</title> | ||
<link rel="shortcut icon" href="/icon.png"/> | ||
<link rel="stylesheet" href="../pylit.css?v=1"> | ||
<link rel="canonical" href="https://nn.labml.ai/RWKV/configs.html"/> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css" integrity="sha384-zTROYFVGOfTw7JV7KUu8udsvW2fx4lWOsCEDqhBreBwlHI4ioVRtmIvEThzJHGET" crossorigin="anonymous"> | ||
|
||
<!-- Global site tag (gtag.js) - Google Analytics --> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4V3HC8HBLH"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
|
||
function gtag() { | ||
dataLayer.push(arguments); | ||
} | ||
|
||
gtag('js', new Date()); | ||
|
||
gtag('config', 'G-4V3HC8HBLH'); | ||
</script> | ||
</head> | ||
<body> | ||
<div id='container'> | ||
<div id="background"></div> | ||
<div class='section'> | ||
<div class='docs'> | ||
<p> | ||
<a class="parent" href="/">home</a> | ||
<a class="parent" href="index.html">RWKV</a> | ||
</p> | ||
<p> | ||
<a href="https://github.com/labmlai/annotated_deep_learning_paper_implementations" target="_blank"> | ||
<img alt="Github" | ||
src="https://img.shields.io/github/stars/labmlai/annotated_deep_learning_paper_implementations?style=social" | ||
style="max-width:100%;"/></a> | ||
<a href="https://twitter.com/labmlai" rel="nofollow" target="_blank"> | ||
<img alt="Twitter" | ||
src="https://img.shields.io/twitter/follow/labmlai?style=social" | ||
style="max-width:100%;"/></a> | ||
</p> | ||
<p> | ||
<a href="https://github.com/labmlai/annotated_deep_learning_paper_implementations/tree/master/labml_nn/RWKV/configs.py" target="_blank"> | ||
View code on Github</a> | ||
</p> | ||
</div> | ||
</div> | ||
<div class='section' id='section-0'> | ||
<div class='docs'> | ||
<div class='section-link'> | ||
<a href='#section-0'>#</a> | ||
</div> | ||
|
||
</div> | ||
<div class='code'> | ||
<div class="highlight"><pre><span class="lineno">1</span><span></span><span class="kn">from</span> <span class="nn">labml.configs</span> <span class="kn">import</span> <span class="n">BaseConfigs</span></pre></div> | ||
</div> | ||
</div> | ||
<div class='section' id='section-1'> | ||
<div class='docs doc-strings'> | ||
<div class='section-link'> | ||
<a href='#section-1'>#</a> | ||
</div> | ||
<h2>Transformer Configurations</h2> | ||
<p>This defines configurations for a transformer. The configurations are calculate using option functions. These are lazy loaded and therefore only the necessary modules are calculated.</p> | ||
|
||
</div> | ||
<div class='code'> | ||
<div class="highlight"><pre><span class="lineno">4</span><span class="k">class</span> <span class="nc">RWKVConfigs</span><span class="p">(</span><span class="n">BaseConfigs</span><span class="p">):</span></pre></div> | ||
</div> | ||
</div> | ||
<div class='section' id='section-2'> | ||
<div class='docs'> | ||
<div class='section-link'> | ||
<a href='#section-2'>#</a> | ||
</div> | ||
<p>Number of attention heads </p> | ||
|
||
</div> | ||
<div class='code'> | ||
<div class="highlight"><pre><span class="lineno">14</span> <span class="n">n_heads</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">8</span></pre></div> | ||
</div> | ||
</div> | ||
<div class='section' id='section-3'> | ||
<div class='docs'> | ||
<div class='section-link'> | ||
<a href='#section-3'>#</a> | ||
</div> | ||
<p>Transformer embedding size </p> | ||
|
||
</div> | ||
<div class='code'> | ||
<div class="highlight"><pre><span class="lineno">16</span> <span class="n">d_model</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">512</span></pre></div> | ||
</div> | ||
</div> | ||
<div class='section' id='section-4'> | ||
<div class='docs'> | ||
<div class='section-link'> | ||
<a href='#section-4'>#</a> | ||
</div> | ||
<p>Number of layers </p> | ||
|
||
</div> | ||
<div class='code'> | ||
<div class="highlight"><pre><span class="lineno">18</span> <span class="n">n_layers</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="mi">6</span></pre></div> | ||
</div> | ||
</div> | ||
<div class='section' id='section-5'> | ||
<div class='docs'> | ||
<div class='section-link'> | ||
<a href='#section-5'>#</a> | ||
</div> | ||
<p>Dropout probability </p> | ||
|
||
</div> | ||
<div class='code'> | ||
<div class="highlight"><pre><span class="lineno">20</span> <span class="n">dropout</span><span class="p">:</span> <span class="nb">float</span> <span class="o">=</span> <span class="mf">0.1</span></pre></div> | ||
</div> | ||
</div> | ||
<div class='section' id='section-6'> | ||
<div class='docs'> | ||
<div class='section-link'> | ||
<a href='#section-6'>#</a> | ||
</div> | ||
<p>Number of tokens in the source vocabulary (for token embeddings) </p> | ||
|
||
</div> | ||
<div class='code'> | ||
<div class="highlight"><pre><span class="lineno">22</span> <span class="n">n_src_vocab</span><span class="p">:</span> <span class="nb">int</span></pre></div> | ||
</div> | ||
</div> | ||
<div class='section' id='section-7'> | ||
<div class='docs'> | ||
<div class='section-link'> | ||
<a href='#section-7'>#</a> | ||
</div> | ||
<p>Number of tokens in the target vocabulary (to generate logits for prediction) </p> | ||
|
||
</div> | ||
<div class='code'> | ||
<div class="highlight"><pre><span class="lineno">24</span> <span class="n">n_tgt_vocab</span><span class="p">:</span> <span class="nb">int</span></pre></div> | ||
</div> | ||
</div> | ||
<div class='footer'> | ||
<a href="https://papers.labml.ai">Trending Research Papers</a> | ||
<a href="https://labml.ai">labml.ai</a> | ||
</div> | ||
</div> | ||
<script src=../interactive.js?v=1"></script> | ||
<script> | ||
function handleImages() { | ||
var images = document.querySelectorAll('p>img') | ||
|
||
for (var i = 0; i < images.length; ++i) { | ||
handleImage(images[i]) | ||
} | ||
} | ||
|
||
function handleImage(img) { | ||
img.parentElement.style.textAlign = 'center' | ||
|
||
var modal = document.createElement('div') | ||
modal.id = 'modal' | ||
|
||
var modalContent = document.createElement('div') | ||
modal.appendChild(modalContent) | ||
|
||
var modalImage = document.createElement('img') | ||
modalContent.appendChild(modalImage) | ||
|
||
var span = document.createElement('span') | ||
span.classList.add('close') | ||
span.textContent = 'x' | ||
modal.appendChild(span) | ||
|
||
img.onclick = function () { | ||
console.log('clicked') | ||
document.body.appendChild(modal) | ||
modalImage.src = img.src | ||
} | ||
|
||
span.onclick = function () { | ||
document.body.removeChild(modal) | ||
} | ||
} | ||
|
||
handleImages() | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.