|
7 | 7 | "<img align=\"left\" src = https://project.lsst.org/sites/default/files/Rubin-O-Logo_0.png width=250 style=\"padding: 10px\"> \n", |
8 | 8 | "<br><b> Introduction to AI-based Image Classification with Pytorch</b> <br>\n", |
9 | 9 | "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", |
12 | 12 | "Container size: medium <br>\n", |
13 | 13 | "Targeted learning level: beginner <br>" |
14 | 14 | ] |
|
188 | 188 | { |
189 | 189 | "cell_type": "code", |
190 | 190 | "execution_count": null, |
191 | | - "metadata": { |
192 | | - "jupyter": { |
193 | | - "source_hidden": true |
194 | | - } |
195 | | - }, |
| 191 | + "metadata": {}, |
196 | 192 | "outputs": [], |
197 | 193 | "source": [ |
198 | 194 | "def normalizeInputs(x_temp, input_minimum, input_maximum):\n", |
|
434 | 430 | " img, label = subset_train[sample_idx]\n", |
435 | 431 | " ax = axes[i//num_col, i%num_col]\n", |
436 | 432 | " img_temp = img[0, :, :]\n", |
437 | | - " img_temp = np.asarray(img_temp).flat\n", |
| 433 | + " img_temp = np.array(img_temp).flat\n", |
438 | 434 | " ax.hist(img_temp, bins=n_bins, color='gray')\n", |
439 | 435 | " ax.set_title(\"label (digit): \" + labels_map[label])\n", |
440 | 436 | " ax.set_xlabel(\"Pixel Values\")\n", |
|
951 | 947 | { |
952 | 948 | "cell_type": "code", |
953 | 949 | "execution_count": null, |
954 | | - "metadata": {}, |
| 950 | + "metadata": { |
| 951 | + "jupyter": { |
| 952 | + "source_hidden": true |
| 953 | + } |
| 954 | + }, |
955 | 955 | "outputs": [], |
956 | 956 | "source": [ |
957 | 957 | "def plotROCMulticlassOnevsrest(y_tra, y_tes, y_pred_tes,\n", |
|
1122 | 1122 | "path_dict = {'run_label': run_label,\n", |
1123 | 1123 | " 'dir_data_model': path_temp + \"/Models/\",\n", |
1124 | 1124 | " '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", |
1126 | 1126 | " 'file_model_prefix': \"Model\",\n", |
1127 | 1127 | " 'file_figure_prefix': \"Figure\",\n", |
1128 | 1128 | " 'file_figure_suffix': \".png\",\n", |
|
1207 | 1207 | "cell_type": "markdown", |
1208 | 1208 | "metadata": {}, |
1209 | 1209 | "source": [ |
1210 | | - "#### 2.1.2. Download data" |
| 1210 | + "#### 2.1.2. Retrieve data" |
1211 | 1211 | ] |
1212 | 1212 | }, |
1213 | 1213 | { |
1214 | 1214 | "cell_type": "markdown", |
1215 | 1215 | "metadata": {}, |
1216 | 1216 | "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." |
1218 | 1218 | ] |
1219 | 1219 | }, |
1220 | 1220 | { |
|
1223 | 1223 | "metadata": {}, |
1224 | 1224 | "outputs": [], |
1225 | 1225 | "source": [ |
1226 | | - "%%time\n", |
1227 | 1226 | "dataset = torchvision.datasets.MNIST(root=path_dict['dir_data_data'], train=True,\n", |
1228 | | - " download=True, transform=transform)" |
| 1227 | + " download=False, transform=transform)" |
1229 | 1228 | ] |
1230 | 1229 | }, |
1231 | 1230 | { |
|
1422 | 1421 | "source": [ |
1423 | 1422 | "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", |
1424 | 1423 | "\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." |
1426 | 1427 | ] |
1427 | 1428 | }, |
1428 | 1429 | { |
|
0 commit comments