Skip to content

Commit

Permalink
docs button
Browse files Browse the repository at this point in the history
  • Loading branch information
ASEM000 committed Sep 8, 2023
1 parent 75594de commit a9fdf41
Show file tree
Hide file tree
Showing 9 changed files with 166 additions and 113 deletions.
14 changes: 14 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,20 @@
nbsphinx_codecell_lexer = "ipython"
nbsphinx_kernel_name = "python"
nbsphinx_timeout = 180
# source: https://github.com/NTT123/pax/blob/main/docs/conf.py
nbsphinx_prolog = r"""
{% set docname = 'docs/' + env.doc2path(env.docname, base=None) %}
.. only:: html
.. role:: raw-html(raw)
:format: html
.. nbinfo::
Open in colab:
:raw-html:`<a href="https://colab.research.google.com/github/asem000/serket/blob/main/{{ docname }}"><img alt="Open In Colab" src="https://colab.research.google.com/assets/colab-badge.svg" style="vertical-align:text-bottom"></a>`
"""

# Tell sphinx-autodoc-typehints to generate stub parameter annotations including
# types, even if the parameters aren't explicitly documented.
Expand Down
25 changes: 17 additions & 8 deletions docs/notebooks/layers_overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
"# 📙 `serket.nn` layers overview"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"!pip install git+https://github.com/ASEM000/serket --quiet"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -44,7 +53,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -126,7 +135,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -167,7 +176,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand All @@ -176,14 +185,14 @@
"Linear(\n",
" in_features=(10), \n",
" out_features=5, \n",
" weight_init=he_normal, \n",
" bias_init=ones, \n",
" weight=f16[10,5](μ=0.08, σ=0.43, ∈[-1.01,0.87]), \n",
" bias=f16[5](μ=1.00, σ=0.00, ∈[1.00,1.00])\n",
" weight_init=glorot_uniform, \n",
" bias_init=zeros, \n",
" weight=f16[10,5](μ=0.07, σ=0.35, ∈[-0.63,0.60]), \n",
" bias=f16[5](μ=0.00, σ=0.00, ∈[0.00,0.00])\n",
")"
]
},
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
Expand Down
15 changes: 12 additions & 3 deletions docs/notebooks/lazy_initialization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,23 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"!pip install git+https://github.com/ASEM000/serket --quiet"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(5, 10)"
]
},
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -51,7 +60,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand All @@ -60,7 +69,7 @@
"(5, 10)"
]
},
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand Down
11 changes: 10 additions & 1 deletion docs/notebooks/mental_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"!pip install git+https://github.com/ASEM000/serket --quiet"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"import jax\n",
"import functools as ft\n",
Expand Down Expand Up @@ -62,7 +71,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down
11 changes: 10 additions & 1 deletion docs/notebooks/regularization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"!pip install git+https://github.com/ASEM000/serket --quiet"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -67,7 +76,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down
25 changes: 17 additions & 8 deletions docs/notebooks/train_bilstm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
"# 🚆 Train bidirectional-`LSTM`"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"!pip install git+https://github.com/ASEM000/serket --quiet"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -16,7 +25,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -42,7 +51,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -70,7 +79,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -106,7 +115,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -149,23 +158,23 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Epoch: 100/100\tBatch: 100/100\tBatch loss: 1.485198e-03\tTime: 0.018\r"
"Epoch: 100/100\tBatch: 100/100\tBatch loss: 1.485198e-03\tTime: 0.020\r"
]
},
{
"data": {
"text/plain": [
"<matplotlib.legend.Legend at 0x16d857220>"
"<matplotlib.legend.Legend at 0x148c532b0>"
]
},
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
},
Expand Down
59 changes: 34 additions & 25 deletions docs/notebooks/train_eval.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit a9fdf41

Please sign in to comment.