mirror of
https://github.com/ArthurDanjou/ml_exercises.git
synced 2026-01-31 12:17:51 +01:00
minor changes to notebooks
This commit is contained in:
@@ -54,7 +54,8 @@
|
||||
"source": [
|
||||
"# reshape image into a matrix with RGB values for each pixel\n",
|
||||
"h, w, d = img_array.shape\n",
|
||||
"X = ... # TODO: reshape img_array such that X is a matrix of shape n_pixels x 3 RGB channels\n",
|
||||
"X = new_X.reshape(h*w, d)\n",
|
||||
"# 1 pixel = 1 data point; RGB values = features\n",
|
||||
"print(X.shape)"
|
||||
]
|
||||
},
|
||||
@@ -122,7 +123,7 @@
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# reshape back into image format\n",
|
||||
"img_new = new_X.reshape(h, w, d)\n",
|
||||
"img_new = ... # TODO: reshape new_X such that img_new is a matrix of shape height x width x 3 RGB channels\n",
|
||||
"print(img_new.shape)"
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user