Skip to content

Commit

Permalink
updated ipynb files
Browse files Browse the repository at this point in the history
  • Loading branch information
Neilblaze committed Apr 20, 2023
1 parent dd38e9f commit 71190b7
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 49 deletions.
40 changes: 20 additions & 20 deletions docs/guides/flax_basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {
"id": "qdrEVv9tinJn",
"outputId": "e30aa464-fa52-4f35-df96-716c68a4b3ee",
Expand All @@ -60,7 +60,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {
"id": "kN6bZDaReZO2"
},
Expand Down Expand Up @@ -90,7 +90,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"id": "zWX2zEtphT4Y"
},
Expand All @@ -115,7 +115,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {
"id": "K529lhzeYtl8",
"outputId": "06feb9d2-db50-4f41-c169-6df4336f43a5"
Expand Down Expand Up @@ -182,7 +182,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {
"id": "HtOFWeiynaJo",
"outputId": "689b4230-2a3d-4823-d103-2858e6debc4d"
Expand Down Expand Up @@ -214,7 +214,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {
"id": "J8ietJecWiuK",
"outputId": "7bbe6bb4-94d5-4574-fbb5-aa0fcd1c84ae"
Expand Down Expand Up @@ -254,7 +254,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {
"id": "bFIiMnL4dl-e",
"outputId": "6eae59dc-0632-4f53-eac8-c22a7c646a52"
Expand Down Expand Up @@ -300,7 +300,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {
"id": "JqJaVc7BeNyT"
},
Expand Down Expand Up @@ -328,7 +328,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {
"id": "ePEl1ndse0Jq",
"outputId": "50d975b3-4706-4d8a-c4b8-2629ab8e3ac4"
Expand Down Expand Up @@ -405,7 +405,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {
"id": "Ce77uDJx1bUF"
},
Expand All @@ -419,7 +419,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {
"id": "PTSv0vx13xPO",
"outputId": "eec0c096-1d9e-4b3c-f8e5-942ee63828ec"
Expand Down Expand Up @@ -465,7 +465,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"metadata": {
"id": "BiUPRU93XnAZ",
"outputId": "b97e7d83-3e40-4a80-b1fe-1f6ceff30a0c"
Expand Down Expand Up @@ -524,7 +524,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"metadata": {
"id": "MOhoBDCOYYJ5",
"outputId": "13acc4e1-8757-4554-e2c8-d594ba6e67dc"
Expand Down Expand Up @@ -589,7 +589,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": null,
"metadata": {
"id": "vbfrfbkxgPhg",
"outputId": "b59c679c-d164-4fd6-92db-b50f0d310ec3"
Expand Down Expand Up @@ -662,7 +662,7 @@
},
{
"cell_type": "code",
"execution_count": 19,
"execution_count": null,
"metadata": {
"id": "DEYrVA6dnaJu",
"outputId": "4af16ec5-b52a-43b0-fc47-1f8ab25e7058"
Expand Down Expand Up @@ -694,7 +694,7 @@
},
{
"cell_type": "code",
"execution_count": 20,
"execution_count": null,
"metadata": {
"id": "ZTCbdpQ4suSK",
"outputId": "183a74ef-f54e-4848-99bf-fee4c174ba6d"
Expand Down Expand Up @@ -770,7 +770,7 @@
},
{
"cell_type": "code",
"execution_count": 21,
"execution_count": null,
"metadata": {
"id": "wK371Pt_vVfR",
"outputId": "83b5fea4-071e-4ea0-8fa8-610e69fb5fd5"
Expand Down Expand Up @@ -861,7 +861,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": null,
"metadata": {
"id": "J6_tR-nPzB1i",
"outputId": "75465fd6-cdc8-497c-a3ec-7f709b5dde7a"
Expand Down Expand Up @@ -928,7 +928,7 @@
},
{
"cell_type": "code",
"execution_count": 23,
"execution_count": null,
"metadata": {
"id": "IbTsCAvZcdBy",
"outputId": "09a8bdd1-eaf8-401a-cf7c-386a7a5aa87b"
Expand Down Expand Up @@ -981,7 +981,7 @@
},
{
"cell_type": "code",
"execution_count": 29,
"execution_count": null,
"metadata": {
"id": "TUgAbUPpnaJw",
"outputId": "0906fbab-b866-4956-d231-b1374415d448"
Expand Down
35 changes: 20 additions & 15 deletions docs/notebooks/full_eval.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {
"id": "62DTHYCYHWp1",
"outputId": "b38d096f-58db-4d61-effa-eafa4c732826",
Expand Down Expand Up @@ -56,7 +56,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {
"id": "NdzAaRwVExA9"
},
Expand All @@ -80,7 +80,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"id": "E30SS9gCIvrV"
},
Expand All @@ -92,7 +92,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {
"id": "bZ-HWxKZHf6I",
"outputId": "639262cb-b617-4561-c31f-60b33156a15f"
Expand Down Expand Up @@ -141,7 +141,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {
"id": "yfGNjMBFWEUk",
"outputId": "09f0c28b-d28e-4a7a-8afe-8797da44ad6d"
Expand Down Expand Up @@ -196,7 +196,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {
"id": "eFPK-Oysl1YS",
"outputId": "293bd0e4-011e-41b4-de48-a53b9cfd0958"
Expand Down Expand Up @@ -226,7 +226,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {
"id": "DlAJwgYDmoxe",
"outputId": "8bb353f3-98db-4645-e627-3c3683e36ea9"
Expand Down Expand Up @@ -256,7 +256,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {
"id": "oUb7QrR2Iwk9",
"outputId": "19234b4a-9f9c-47c4-cbcc-5f7fb2573746"
Expand Down Expand Up @@ -305,7 +305,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {
"id": "dlJuEBcLKY94",
"outputId": "e94cf79c-a033-4bc3-a086-75ecd8bd21f0"
Expand Down Expand Up @@ -375,7 +375,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {
"id": "I1hg8paaasXj",
"outputId": "2e6c611d-357e-4e51-99d8-47c24d785b11"
Expand Down Expand Up @@ -441,7 +441,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"metadata": {
"id": "pQX__5DfEX9g",
"outputId": "71017214-c4ce-4da0-8db5-9300dba79c3a"
Expand Down Expand Up @@ -493,15 +493,20 @@
},
{
"cell_type": "markdown",
"metadata": {},
"metadata": {
"id": "eVGijAiLoAIQ"
},
"source": [
"#### Computing metrics in `eval_step`"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"execution_count": null,
"metadata": {
"id": "IXxDVfmkoAIQ",
"outputId": "4c1dd7be-efb5-4a7a-898c-89a1350e21f3"
},
"outputs": [
{
"name": "stdout",
Expand Down Expand Up @@ -560,7 +565,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"metadata": {
"id": "MjtmUUjWPV1X",
"outputId": "70ee173a-dcdf-4136-a3e0-6685c09f8198"
Expand Down
5 changes: 5 additions & 0 deletions docs/notebooks/full_eval.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,14 @@ correct = correct.item()
correct, total, correct / total
```

+++ {"id": "eVGijAiLoAIQ"}

#### Computing metrics in `eval_step`

```{code-cell} ipython3
:id: IXxDVfmkoAIQ
:outputId: 4c1dd7be-efb5-4a7a-898c-89a1350e21f3
# moving the metrics computation into `eval_step()` and using `static_return`
# this pattern is often used with more complicated `clu.metrics`
Expand Down
Loading

0 comments on commit 71190b7

Please sign in to comment.