Skip to content

Commit 38f994a

Browse files
committed
capsnet readme
1 parent bfe089f commit 38f994a

File tree

7 files changed

+156
-9
lines changed

7 files changed

+156
-9
lines changed

docs/capsule_networks/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ <h1>Capsule Networks</h1>
7777
<p>Capsule network is a neural network architecture that embeds features
7878
as capsules and routes them with a voting mechanism to next layer of capsules.</p>
7979
<p>Unlike in other implementations of models, we&rsquo;ve included a sample, because
80-
it is difficult to understand some of the concepts with just the modules.
80+
it is difficult to understand some concepts with just the modules.
8181
<a href="mnist.html">This is the annotated code for a model that uses capsules to classify MNIST dataset</a></p>
8282
<p>This file holds the implementations of the core modules of Capsule Networks.</p>
8383
<p>I used <a href="https://github.com/jindongwang/Pytorch-CapsuleNet">jindongwang/Pytorch-CapsuleNet</a> to clarify some

docs/capsule_networks/readme.html

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
6+
<meta name="description" content=""/>
7+
8+
<meta name="twitter:card" content="summary"/>
9+
<meta name="twitter:image:src" content="https://avatars1.githubusercontent.com/u/64068543?s=400&amp;v=4"/>
10+
<meta name="twitter:title" content="Capsule Networks"/>
11+
<meta name="twitter:description" content=""/>
12+
<meta name="twitter:site" content="@labmlai"/>
13+
<meta name="twitter:creator" content="@labmlai"/>
14+
15+
<meta property="og:url" content="https://nn.labml.ai/capsule_networks/readme.html"/>
16+
<meta property="og:title" content="Capsule Networks"/>
17+
<meta property="og:image" content="https://avatars1.githubusercontent.com/u/64068543?s=400&amp;v=4"/>
18+
<meta property="og:site_name" content="LabML Neural Networks"/>
19+
<meta property="og:type" content="object"/>
20+
<meta property="og:title" content="Capsule Networks"/>
21+
<meta property="og:description" content=""/>
22+
23+
<title>Capsule Networks</title>
24+
<link rel="shortcut icon" href="/icon.png"/>
25+
<link rel="stylesheet" href="../pylit.css">
26+
<link rel="canonical" href="https://nn.labml.ai/capsule_networks/readme.html"/>
27+
<!-- Global site tag (gtag.js) - Google Analytics -->
28+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4V3HC8HBLH"></script>
29+
<script>
30+
window.dataLayer = window.dataLayer || [];
31+
32+
function gtag() {
33+
dataLayer.push(arguments);
34+
}
35+
36+
gtag('js', new Date());
37+
38+
gtag('config', 'G-4V3HC8HBLH');
39+
</script>
40+
</head>
41+
<body>
42+
<div id='container'>
43+
<div id="background"></div>
44+
<div class='section'>
45+
<div class='docs'>
46+
<p>
47+
<a class="parent" href="/">home</a>
48+
<a class="parent" href="index.html">capsule_networks</a>
49+
</p>
50+
<p>
51+
52+
<a href="https://github.com/lab-ml/labml_nn/tree/master/labml_nn/capsule_networks/readme.md">
53+
<img alt="Github"
54+
src="https://img.shields.io/github/stars/lab-ml/nn?style=social"
55+
style="max-width:100%;"/></a>
56+
<a href="https://join.slack.com/t/labforml/shared_invite/zt-egj9zvq9-Dl3hhZqobexgT7aVKnD14g/"
57+
rel="nofollow">
58+
<img alt="Join Slact"
59+
src="https://img.shields.io/badge/slack-chat-green.svg?logo=slack"
60+
style="max-width:100%;"/></a>
61+
<a href="https://twitter.com/labmlai"
62+
rel="nofollow">
63+
<img alt="Twitter"
64+
src="https://img.shields.io/twitter/follow/labmlai?style=social"
65+
style="max-width:100%;"/></a>
66+
</p>
67+
</div>
68+
</div>
69+
<div class='section' id='section-0'>
70+
<div class='docs'>
71+
<div class='section-link'>
72+
<a href='#section-0'>#</a>
73+
</div>
74+
<h1><a href="https://nn.labml.ai/capsule_networks/index.html">Capsule Networks</a></h1>
75+
<p>This is a <a href="https://pytorch.org">PyTorch</a> implementation/tutorial of
76+
<a href="https://arxiv.org/abs/1710.09829">Dynamic Routing Between Capsules</a>.</p>
77+
<p>Capsule network is a neural network architecture that embeds features
78+
as capsules and routes them with a voting mechanism to next layer of capsules.</p>
79+
<p>Unlike in other implementations of models, we&rsquo;ve included a sample, because
80+
it is difficult to understand some concepts with just the modules.
81+
<a href="mnist.html">This is the annotated code for a model that uses capsules to classify MNIST dataset</a></p>
82+
<p>This file holds the implementations of the core modules of Capsule Networks.</p>
83+
<p>I used <a href="https://github.com/jindongwang/Pytorch-CapsuleNet">jindongwang/Pytorch-CapsuleNet</a> to clarify some
84+
confusions I had with the paper.</p>
85+
<p>Here&rsquo;s a notebook for training a Capsule Network on MNIST dataset.</p>
86+
<p><a href="https://colab.research.google.com/github/lab-ml/nn/blob/master/labml_nn/capsule_networks/mnist.ipynb"><img alt="Open In Colab" src="https://colab.research.google.com/assets/colab-badge.svg" /></a>
87+
<a href="https://app.labml.ai/run/e7c08e08586711ebb3e30242ac1c0002"><img alt="View Run" src="https://img.shields.io/badge/labml-experiment-brightgreen" /></a></p>
88+
</div>
89+
<div class='code'>
90+
91+
</div>
92+
</div>
93+
</div>
94+
</div>
95+
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.4/MathJax.js?config=TeX-AMS_HTML">
96+
</script>
97+
<!-- MathJax configuration -->
98+
<script type="text/x-mathjax-config">
99+
MathJax.Hub.Config({
100+
tex2jax: {
101+
inlineMath: [ ['$','$'] ],
102+
displayMath: [ ['$$','$$'] ],
103+
processEscapes: true,
104+
processEnvironments: true
105+
},
106+
// Center justify equations in code and markdown cells. Elsewhere
107+
// we use CSS to left justify single line equations in code cells.
108+
displayAlign: 'center',
109+
"HTML-CSS": { fonts: ["TeX"] }
110+
});
111+
112+
113+
114+
115+
116+
117+
118+
119+
120+
121+
122+
123+
124+
</script>
125+
</body>
126+
</html>

docs/rl/ppo/gae.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ <h3>Calculate advantages</h3>
123123
\hat{A_t^{(\infty)}} &= r_t + \gamma r_{t+1} +\gamma^2 r_{t+1} + ... - V(s)
124124
\end{align}</script>
125125
</p>
126-
<p>$\hat{A_t^{(1)}}$ is high bias, low variance whilst
126+
<p>$\hat{A_t^{(1)}}$ is high bias, low variance, whilst
127127
$\hat{A_t^{(\infty)}}$ is unbiased, high variance.</p>
128128
<p>We take a weighted average of $\hat{A_t^{(k)}}$ to balance bias and variance.
129129
This is called Generalized Advantage Estimation.

docs/rl/ppo/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ <h1>Proximal Policy Optimization (PPO)</h1>
7676
<p>This is a <a href="https://pytorch.org">PyTorch</a> implementation of
7777
<a href="https://arxiv.org/abs/1707.06347">Proximal Policy Optimization - PPO</a>.</p>
7878
<p>PPO is a policy gradient method for reinforcement learning.
79-
Simple policy gradient methods one do a single gradient update per sample (or a set of samples).
80-
Doing multiple gradient steps for a singe sample causes problems
81-
because the policy deviates too much producing a bad policy.
79+
Simple policy gradient methods do a single gradient update per sample (or a set of samples).
80+
Doing multiple gradient steps for a single sample causes problems
81+
because the policy deviates too much, producing a bad policy.
8282
PPO lets us do multiple gradient updates per sample by trying to keep the
8383
policy close to the policy that was used to sample data.
8484
It does so by clipping gradient flow if the updated policy
@@ -172,7 +172,7 @@ <h2>PPO Loss</h2>
172172
</p>
173173
<p>Then we assume $d^\pi_\theta(s)$ and $d^\pi_{\theta_{OLD}}(s)$ are similar.
174174
The error we introduce to $J(\pi_\theta) - J(\pi_{\theta_{OLD}})$
175-
by this assumtion is bound by the KL divergence between
175+
by this assumption is bound by the KL divergence between
176176
$\pi_\theta$ and $\pi_{\theta_{OLD}}$.
177177
<a href="https://arxiv.org/abs/1705.10528">Constrained Policy Optimization</a>
178178
shows the proof of this. I haven&rsquo;t read it.</p>

docs/sitemap.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,14 +659,14 @@
659659

660660
<url>
661661
<loc>https://nn.labml.ai/rl/ppo/index.html</loc>
662-
<lastmod>2021-02-23T16:30:00+00:00</lastmod>
662+
<lastmod>2021-03-05T16:30:00+00:00</lastmod>
663663
<priority>1.00</priority>
664664
</url>
665665

666666

667667
<url>
668668
<loc>https://nn.labml.ai/rl/ppo/gae.html</loc>
669-
<lastmod>2021-01-30T16:30:00+00:00</lastmod>
669+
<lastmod>2021-03-05T16:30:00+00:00</lastmod>
670670
<priority>1.00</priority>
671671
</url>
672672

labml_nn/capsule_networks/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
as capsules and routes them with a voting mechanism to next layer of capsules.
1717
1818
Unlike in other implementations of models, we've included a sample, because
19-
it is difficult to understand some of the concepts with just the modules.
19+
it is difficult to understand some concepts with just the modules.
2020
[This is the annotated code for a model that uses capsules to classify MNIST dataset](mnist.html)
2121
2222
This file holds the implementations of the core modules of Capsule Networks.

labml_nn/capsule_networks/readme.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# [Capsule Networks](https://nn.labml.ai/capsule_networks/index.html)
2+
3+
This is a [PyTorch](https://pytorch.org) implementation/tutorial of
4+
[Dynamic Routing Between Capsules](https://arxiv.org/abs/1710.09829).
5+
6+
Capsule network is a neural network architecture that embeds features
7+
as capsules and routes them with a voting mechanism to next layer of capsules.
8+
9+
Unlike in other implementations of models, we've included a sample, because
10+
it is difficult to understand some concepts with just the modules.
11+
[This is the annotated code for a model that uses capsules to classify MNIST dataset](mnist.html)
12+
13+
This file holds the implementations of the core modules of Capsule Networks.
14+
15+
I used [jindongwang/Pytorch-CapsuleNet](https://github.com/jindongwang/Pytorch-CapsuleNet) to clarify some
16+
confusions I had with the paper.
17+
18+
Here's a notebook for training a Capsule Network on MNIST dataset.
19+
20+
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/lab-ml/nn/blob/master/labml_nn/capsule_networks/mnist.ipynb)
21+
[![View Run](https://img.shields.io/badge/labml-experiment-brightgreen)](https://app.labml.ai/run/e7c08e08586711ebb3e30242ac1c0002)

0 commit comments

Comments
 (0)