Skip to content

Commit 3aa0ef2

Browse files
committed
Created using Colab
1 parent 7399e59 commit 3aa0ef2

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

colab_notebooks/Notebook07_CNNs_PyTorch.ipynb

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
{
22
"cells": [
3-
{
4-
"cell_type": "markdown",
5-
"metadata": {
6-
"id": "view-in-github",
7-
"colab_type": "text"
8-
},
9-
"source": [
10-
"<a href=\"https://colab.research.google.com/github/ssec/WAF_ML_Tutorial_Part2/blob/main/colab_notebooks/Notebook07_CNNs_PyTorch.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
11-
]
12-
},
133
{
144
"cell_type": "markdown",
155
"metadata": {
@@ -127,20 +117,21 @@
127117
},
128118
{
129119
"cell_type": "code",
130-
"execution_count": 33,
120+
"execution_count": 64,
131121
"metadata": {
132122
"colab": {
133123
"base_uri": "https://localhost:8080/"
134124
},
135125
"id": "8SjBWq91QCCE",
136-
"outputId": "e6e711ff-8e72-4f07-9dff-a8f1a90296f9"
126+
"outputId": "d45da2e5-b6fc-461c-812c-fa59f374b1f3"
137127
},
138128
"outputs": [
139129
{
140130
"output_type": "stream",
141131
"name": "stdout",
142132
"text": [
143-
"Using device: cpu\n"
133+
"Using device: cpu\n",
134+
"Set random seed: 42\n"
144135
]
145136
}
146137
],
@@ -179,10 +170,12 @@
179170
"# Set device to GPU if available, else CPU\n",
180171
"device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n",
181172
"print(f\"Using device: {device}\")\n",
173+
"\n",
182174
"seed = 42\n",
183175
"torch.manual_seed(seed)\n",
184176
"if torch.cuda.is_available():\n",
185-
" torch.cuda.manual_seed(seed)"
177+
" torch.cuda.manual_seed(seed)\n",
178+
"print(f\"Set random seed: {seed}\")"
186179
]
187180
},
188181
{
@@ -800,9 +793,6 @@
800793
"train_dataset = SubSevirDataset(ds_train)\n",
801794
"val_dataset = SubSevirDataset(ds_val)\n",
802795
"\n",
803-
"# Set random seed\n",
804-
"torch.manual_seed(42)\n",
805-
"\n",
806796
"# Create DataLoaders\n",
807797
"batch_size = 32\n",
808798
"train_loader = DataLoader(train_dataset, batch_size=batch_size, shuffle=True)\n",
@@ -2371,8 +2361,7 @@
23712361
"name": "python"
23722362
},
23732363
"colab": {
2374-
"provenance": [],
2375-
"include_colab_link": true
2364+
"provenance": []
23762365
},
23772366
"kernelspec": {
23782367
"name": "python3",

0 commit comments

Comments
 (0)