This commit is contained in:
Varuna Jayasiri
2021-01-27 09:20:30 +05:30
parent 8c09a8874f
commit 962a589b12
4 changed files with 526 additions and 0 deletions

View File

@ -22,6 +22,7 @@ uninstall: ## Uninstall
pip uninstall labml_nn
docs: ## Render annotated HTML
python utils/sitemap.py
cd labml_nn; pylit --remove_empty_sections --title_md -t ../../../pylit/templates/nn -d ../docs -w *
pages-old: ## Copy to lab-ml site

464
docs/sitemap.xml Normal file
View File

@ -0,0 +1,464 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>https://nn.labml.ai/gan/cycle_gan.html</loc>
<lastmod>2021-01-23T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/gan/index.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/gan/simple_mnist_experiment.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/gan/dcgan.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/gan/cycle_gan.html</loc>
<lastmod>2021-01-23T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/activations/index.html</loc>
<lastmod>2021-01-25T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/activations/swish.html</loc>
<lastmod>2021-01-25T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/hypernetworks/experiment.html</loc>
<lastmod>2021-01-03T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/hypernetworks/index.html</loc>
<lastmod>2021-01-03T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/hypernetworks/experiment.html</loc>
<lastmod>2021-01-21T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/hypernetworks/hyper_lstm.html</loc>
<lastmod>2021-01-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/experiments/nlp_autoregression.html</loc>
<lastmod>2021-01-25T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/experiments/index.html</loc>
<lastmod>2020-12-26T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/index.html</loc>
<lastmod>2021-01-26T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/optimizers/adam_warmup.html</loc>
<lastmod>2021-01-13T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/optimizers/configs.html</loc>
<lastmod>2021-01-14T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/optimizers/adam_warmup_cosine_decay.html</loc>
<lastmod>2021-01-14T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/optimizers/ada_belief.html</loc>
<lastmod>2021-01-14T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/optimizers/index.html</loc>
<lastmod>2021-01-13T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/optimizers/noam.html</loc>
<lastmod>2020-12-23T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/optimizers/mnist_experiment.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/optimizers/performance_test.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/optimizers/radam.html</loc>
<lastmod>2021-01-13T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/optimizers/adam.html</loc>
<lastmod>2021-01-13T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/optimizers/amsgrad.html</loc>
<lastmod>2020-12-14T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/knn/build_index.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/knn/train_model.html</loc>
<lastmod>2021-01-25T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/knn/index.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/knn/eval_knn.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/configs.html</loc>
<lastmod>2021-01-26T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/models.html</loc>
<lastmod>2021-01-25T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/gpt/experiment.html</loc>
<lastmod>2021-01-25T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/gpt/index.html</loc>
<lastmod>2021-01-26T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/feed_forward.html</loc>
<lastmod>2021-01-26T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/index.html</loc>
<lastmod>2021-01-26T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/feedback/experiment.html</loc>
<lastmod>2021-01-14T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/feedback/index.html</loc>
<lastmod>2021-01-25T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/glu_variants/index.html</loc>
<lastmod>2021-01-26T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/glu_variants/simple.html</loc>
<lastmod>2021-01-26T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/glu_variants/experiment.html</loc>
<lastmod>2021-01-26T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/glu_variants/simple.html</loc>
<lastmod>2021-01-26T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/utils.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/switch/experiment.html</loc>
<lastmod>2021-01-21T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/switch/index.html</loc>
<lastmod>2021-01-25T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/switch/experiment.html</loc>
<lastmod>2021-01-25T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/positional_encoding.html</loc>
<lastmod>2021-01-07T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/label_smoothing_loss.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/mha.html</loc>
<lastmod>2021-01-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/transformers/relative_mha.html</loc>
<lastmod>2021-01-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/utils.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/capsule_networks/mnist.html</loc>
<lastmod>2021-01-17T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/capsule_networks/index.html</loc>
<lastmod>2021-01-17T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/capsule_networks/mnist.html</loc>
<lastmod>2021-01-16T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/recurrent_highway_networks/index.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/sketch_rnn/index.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/rl/game.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/rl/index.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/rl/dqn/index.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/rl/dqn/model.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/rl/dqn/experiment.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/rl/dqn/replay_buffer.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/rl/ppo/index.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/rl/ppo/gae.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/rl/ppo/experiment.html</loc>
<lastmod>2020-12-10T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
<url>
<loc>https://nn.labml.ai/lstm/index.html</loc>
<lastmod>2021-01-03T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
</urlset>

0
utils/__init__.py Normal file
View File

61
utils/sitemap.py Normal file
View File

@ -0,0 +1,61 @@
from pathlib import Path
import git
HOME = Path('./labml_nn')
REPO = git.Repo('.')
def collect(path: Path):
if path.is_file():
try:
commit = next(iter(REPO.iter_commits(paths=path)))
except StopIteration:
return []
html = path.relative_to(HOME)
if html.stem == '__init__':
html = html.parent / 'index.html'
else:
html = html.parent / f'{html.stem}.html'
return [{'path': str(html), 'date': str(commit.committed_datetime.date())}]
urls = []
for f in path.iterdir():
urls += collect(f)
return urls
def main():
urls = []
for f in HOME.iterdir():
urls += collect(f)
urls = [f'''
<url>
<loc>https://nn.labml.ai/{u['path']}</loc>
<lastmod>{u['date']}T16:30:00+00:00</lastmod>
<priority>1.00</priority>
</url>
''' for u in urls]
urls = '\n'.join(urls)
xml = f'''
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
{urls}
</urlset>
'''
with open(str(HOME.parent / 'docs' / 'sitemap.xml'), 'w') as f:
f.write(xml)
if __name__ == '__main__':
main()