Skip to content

Commit 96ffc68

Browse files
Merge pull request #89 from lsst/tickets/SP-2191
Tickets/sp 2191
2 parents a3248fd + 4e52965 commit 96ffc68

1 file changed

Lines changed: 16 additions & 15 deletions

File tree

DP0.2/19a_Introduction_to_AI/19a_Introduction_to_AI.ipynb

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"<img align=\"left\" src = https://project.lsst.org/sites/default/files/Rubin-O-Logo_0.png width=250 style=\"padding: 10px\"> \n",
88
"<br><b> Introduction to AI-based Image Classification with Pytorch</b> <br>\n",
99
"Contact author: Brian Nord <br>\n",
10-
"Last verified to run: 2025-09-02 <br>\n",
11-
"LSST Science Pipelines version: r29.2.0 <br>\n",
10+
"Last verified to run: 2025-10-30 <br>\n",
11+
"LSST Science Pipelines version: Release r29.2.0 <br>\n",
1212
"Container size: medium <br>\n",
1313
"Targeted learning level: beginner <br>"
1414
]
@@ -188,11 +188,7 @@
188188
{
189189
"cell_type": "code",
190190
"execution_count": null,
191-
"metadata": {
192-
"jupyter": {
193-
"source_hidden": true
194-
}
195-
},
191+
"metadata": {},
196192
"outputs": [],
197193
"source": [
198194
"def normalizeInputs(x_temp, input_minimum, input_maximum):\n",
@@ -434,7 +430,7 @@
434430
" img, label = subset_train[sample_idx]\n",
435431
" ax = axes[i//num_col, i%num_col]\n",
436432
" img_temp = img[0, :, :]\n",
437-
" img_temp = np.asarray(img_temp).flat\n",
433+
" img_temp = np.array(img_temp).flat\n",
438434
" ax.hist(img_temp, bins=n_bins, color='gray')\n",
439435
" ax.set_title(\"label (digit): \" + labels_map[label])\n",
440436
" ax.set_xlabel(\"Pixel Values\")\n",
@@ -951,7 +947,11 @@
951947
{
952948
"cell_type": "code",
953949
"execution_count": null,
954-
"metadata": {},
950+
"metadata": {
951+
"jupyter": {
952+
"source_hidden": true
953+
}
954+
},
955955
"outputs": [],
956956
"source": [
957957
"def plotROCMulticlassOnevsrest(y_tra, y_tes, y_pred_tes,\n",
@@ -1122,7 +1122,7 @@
11221122
"path_dict = {'run_label': run_label,\n",
11231123
" 'dir_data_model': path_temp + \"/Models/\",\n",
11241124
" 'dir_data_figures': path_temp + \"/Figures/\",\n",
1125-
" 'dir_data_data': path_temp + \"/Data/\",\n",
1125+
" 'dir_data_data': \"/rubin/cst_repos/tutorial-notebooks-data/data\",\n",
11261126
" 'file_model_prefix': \"Model\",\n",
11271127
" 'file_figure_prefix': \"Figure\",\n",
11281128
" 'file_figure_suffix': \".png\",\n",
@@ -1207,14 +1207,14 @@
12071207
"cell_type": "markdown",
12081208
"metadata": {},
12091209
"source": [
1210-
"#### 2.1.2. Download data"
1210+
"#### 2.1.2. Retrieve data"
12111211
]
12121212
},
12131213
{
12141214
"cell_type": "markdown",
12151215
"metadata": {},
12161216
"source": [
1217-
"Download the data from a remote reserver."
1217+
"Retrieve the data from the Git large file server (LFS). This data was downloaded the Torch servers and saved to the LFS."
12181218
]
12191219
},
12201220
{
@@ -1223,9 +1223,8 @@
12231223
"metadata": {},
12241224
"outputs": [],
12251225
"source": [
1226-
"%%time\n",
12271226
"dataset = torchvision.datasets.MNIST(root=path_dict['dir_data_data'], train=True,\n",
1228-
" download=True, transform=transform)"
1227+
" download=False, transform=transform)"
12291228
]
12301229
},
12311230
{
@@ -1422,7 +1421,9 @@
14221421
"source": [
14231422
"Plot the distributions of pixel values to understand the data further. All pixel data has been normalized, and pixels have values between 0 and 1 only.\n",
14241423
"\n",
1425-
"The distribution of pixel values matches the images shown above: mostly black (values near 0) pixels, with some white (values near 1), and a few grey (values in between 0 and 1)."
1424+
"The distribution of pixel values matches the images shown above: mostly black (values near 0) pixels, with some white (values near 1), and a few grey (values in between 0 and 1).\n",
1425+
"\n",
1426+
"> **Warning:** the following cell produces a DeprecationWarning that is ok to ignore."
14261427
]
14271428
},
14281429
{

0 commit comments

Comments
 (0)