Skip to content

Commit

Permalink
dependency fix
Browse files Browse the repository at this point in the history
  • Loading branch information
glibesyck committed Jul 2, 2024
1 parent b625ac7 commit 8920cf5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 48 deletions.
2 changes: 1 addition & 1 deletion tutorials/W2D4_Macrolearning/W2D4_Intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
12 changes: 11 additions & 1 deletion tutorials/W2D4_Macrolearning/W2D4_Tutorial1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,16 @@
"display(tabs)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# @title Submit your feedback\n",
"content_review(f\"{feedback_prefix}_distribution_shifts_video\")"
]
},
{
"cell_type": "markdown",
"metadata": {
Expand Down Expand Up @@ -976,7 +986,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion tutorials/W2D4_Macrolearning/W2D4_Tutorial2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions tutorials/W2D4_Macrolearning/W2D4_Tutorial3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@
"execution": {}
},
"source": [
"You should be able to see that the meta-loss value is decreasing. Let us look at how the first layer weight values developed throughout the first 100 epochs. Here, we project this high-dimensional weight vector into a two-dimensional space using PCA. Play with the epoch value to see the (outer) evolution of the base weights (the left plot) and see how the (inner) task-specific weights change the total weight values in the given epoch (the right plot). For clarity of visualization, we use only the first ten tasks for each epoch in the inner weight visualizations."
"You should be able to see that the meta-loss value is 0.123 for this case. Let us look at how the first layer weight values developed throughout the first 100 epochs. Here, we project this high-dimensional weight vector into a two-dimensional space using PCA. Play with the epoch value to see the (outer) evolution of the base weights (the left plot) and see how the (inner) task-specific weights change the total weight values in the given epoch (the right plot). For clarity of visualization, we use only the first ten tasks for each epoch in the inner weight visualizations."
]
},
{
Expand Down Expand Up @@ -1643,7 +1643,7 @@
},
"outputs": [],
"source": [
"# @title Make sure you execute this cell to observe the widget!\n",
"# @title Make sure you execute this cell to observe the plot!\n",
"\n",
"set_seed(42)\n",
"\n",
Expand Down Expand Up @@ -1712,7 +1712,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
8 changes: 3 additions & 5 deletions tutorials/W2D4_Macrolearning/W2D4_Tutorial4.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@
"outputs": [],
"source": [
"# @title Make sure you execute this cell to play the game!\n",
"#game()"
"game()"
]
},
{
Expand Down Expand Up @@ -996,8 +996,6 @@
"source": [
"set_seed(42)\n",
"\n",
"device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n",
"\n",
"#define environment\n",
"env = HarlowExperimentEnv()\n",
"\n",
Expand Down Expand Up @@ -1564,7 +1562,7 @@
"execution": {}
},
"source": [
"You should be able to see that the mean population score is `49.72`, and the best score is `100`. If you change `num_generations` to 800 in the previous code cell, the plot for the mean score in the population will roughly take the following form.\n",
" If you change `num_generations` to 800 in the previous code cell, the plot for the mean score in the population will roughly take the following form.\n",
"\n",
"![Picture which depicts the plot of mean scores per generation.](https://github.com/neuromatch/NeuroAI_Course/blob/main/tutorials/W2D4_Macrolearning/static/evolution.png?raw=true)\n",
"\n",
Expand Down Expand Up @@ -1819,7 +1817,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down
39 changes: 2 additions & 37 deletions tutorials/W2D4_Macrolearning/W2D4_Tutorial5.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"source": [
"# @title Install and import feedback gadget\n",
"\n",
"!pip install numpy matplotlib scikit-learn ipywidgets jupyter-ui-poll torch --quiet\n",
"!pip install numpy matplotlib scikit-learn ipywidgets jupyter-ui-poll torch vibecheck --quiet\n",
"\n",
"from vibecheck import DatatopsContentReviewContainer\n",
"def content_review(notebook_section: str):\n",
Expand Down Expand Up @@ -392,41 +392,6 @@
" fid.write(r.content) # Write the downloaded content to a file"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"cellView": "form",
"execution": {}
},
"outputs": [],
"source": [
"# @title Set device (GPU or CPU)\n",
"\n",
"def set_device():\n",
" \"\"\"\n",
" Determines and sets the computational device for PyTorch operations based on the availability of a CUDA-capable GPU.\n",
"\n",
" Outputs:\n",
" - device (str): The device that PyTorch will use for computations ('cuda' or 'cpu'). This string can be directly used\n",
" in PyTorch operations to specify the device.\n",
" \"\"\"\n",
"\n",
" device = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n",
" if device != \"cuda\":\n",
" print(\"GPU is not enabled in this notebook. \\n\"\n",
" \"If you want to enable it, in the menu under `Runtime` -> \\n\"\n",
" \"`Hardware accelerator.` and select `GPU` from the dropdown menu\")\n",
" else:\n",
" print(\"GPU is enabled in this notebook. \\n\"\n",
" \"If you want to disable it, in the menu under `Runtime` -> \\n\"\n",
" \"`Hardware accelerator.` and select `None` from the dropdown menu\")\n",
"\n",
" return device\n",
"\n",
"device = set_device()"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -1617,7 +1582,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.19"
"version": "3.11.5"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 8920cf5

Please sign in to comment.