Skip to content

Commit

Permalink
update: JAX notebooks (#13)
Browse files Browse the repository at this point in the history
* update: JAX notebook run

* update: website build

* update: README

* update: LICENSE

Co-authored-by: alexioannides <[email protected]>
  • Loading branch information
AlexIoannides and alexioannides authored Dec 8, 2022
1 parent 5b034c6 commit e4221ba
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 51 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Alex Ioannides
Copyright (c) 2020-2022 Alex Ioannides

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Data Science and ML Notes and Demos
# Data Science and ML Notebooks and Demos

> "_The best way to learn is by doing, and the best way to remember what you have learnt is it to write about it._"
Expand Down
16 changes: 2 additions & 14 deletions demos/jax/mnist_with_flax_and_optax.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,8 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/alexioannides/Dropbox/work/workspace/python/data-science-and-ml-notebook/.venv_jax/lib/python3.10/site-packages/tqdm/auto.py:22: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
" from .autonotebook import tqdm as notebook_tqdm\n"
]
}
],
"outputs": [],
"source": [
"import warnings\n",
"from typing import Any, Callable, Dict, Tuple\n",
"\n",
"import flax.linen as nn\n",
Expand All @@ -43,9 +33,7 @@
"from flax.training.train_state import TrainState\n",
"from jax import random, numpy as jnp\n",
"from matplotlib import pyplot as plt\n",
"from torch.utils.data import DataLoader\n",
"\n",
"warnings.simplefilter(\"ignore\")"
"from torch.utils.data import DataLoader"
]
},
{
Expand Down
40 changes: 5 additions & 35 deletions docs/jax/mnist_with_flax_and_optax/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2380,8 +2380,8 @@ <h2 id="imports-and-configuration">Imports and Configuration<a class="anchor-lin
</div>
</div>
</div>
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell ">
<div class="jp-Cell jp-CodeCell jp-Notebook-cell ">
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs ">
<div class="jp-Cell jp-CodeCell jp-Notebook-cell jp-mod-noOutputs ">
<div class="jp-Cell-inputWrapper">
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
</div>
Expand All @@ -2401,8 +2401,7 @@ <h2 id="imports-and-configuration">Imports and Configuration<a class="anchor-lin
</div>
</clipboard-copy>
</div>
<div class="highlight-ipynb hl-python"><pre><span></span><span class="kn">import</span> <span class="nn">warnings</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Callable</span><span class="p">,</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">Tuple</span>
<div class="highlight-ipynb hl-python"><pre><span></span><span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Any</span><span class="p">,</span> <span class="n">Callable</span><span class="p">,</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">Tuple</span>

<span class="kn">import</span> <span class="nn">flax.linen</span> <span class="k">as</span> <span class="nn">nn</span>
<span class="kn">import</span> <span class="nn">jax</span>
Expand All @@ -2412,11 +2411,8 @@ <h2 id="imports-and-configuration">Imports and Configuration<a class="anchor-lin
<span class="kn">from</span> <span class="nn">jax</span> <span class="kn">import</span> <span class="n">random</span><span class="p">,</span> <span class="n">numpy</span> <span class="k">as</span> <span class="n">jnp</span>
<span class="kn">from</span> <span class="nn">matplotlib</span> <span class="kn">import</span> <span class="n">pyplot</span> <span class="k">as</span> <span class="n">plt</span>
<span class="kn">from</span> <span class="nn">torch.utils.data</span> <span class="kn">import</span> <span class="n">DataLoader</span>

<span class="n">warnings</span><span class="o">.</span><span class="n">simplefilter</span><span class="p">(</span><span class="s2">&quot;ignore&quot;</span><span class="p">)</span>
</pre></div>
<div id="cell-1" class="clipboard-copy-txt">import warnings
from typing import Any, Callable, Dict, Tuple
<div id="cell-1" class="clipboard-copy-txt">from typing import Any, Callable, Dict, Tuple

import flax.linen as nn
import jax
Expand All @@ -2425,40 +2421,14 @@ <h2 id="imports-and-configuration">Imports and Configuration<a class="anchor-lin
from flax.training.train_state import TrainState
from jax import random, numpy as jnp
from matplotlib import pyplot as plt
from torch.utils.data import DataLoader

warnings.simplefilter("ignore")</div>
from torch.utils.data import DataLoader</div>

</div>
</div>

</div>
</div>

<div class="jp-Cell-outputWrapper">
<div class="jp-Collapser jp-OutputCollapser jp-Cell-outputCollapser">
</div>


<div class="jp-OutputArea jp-Cell-outputArea">

<div class="jp-OutputArea-child">


<div class="jp-OutputPrompt jp-OutputArea-prompt"></div>


<div class="jp-RenderedText jp-OutputArea-output" data-mime-type="application/vnd.jupyter.stderr">
<pre>/Users/alexioannides/Dropbox/work/workspace/python/data-science-and-ml-notebook/.venv_jax/lib/python3.10/site-packages/tqdm/auto.py:22: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
from .autonotebook import tqdm as notebook_tqdm
</pre>
</div>
</div>

</div>

</div>

</div>
</div>
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell">
Expand Down
Binary file modified docs/sitemap.xml.gz
Binary file not shown.

0 comments on commit e4221ba

Please sign in to comment.