Fix comment and simplify 'neighbors' code
parent
b2a1f56988
commit
9286e4f04f
|
@ -1854,7 +1854,7 @@
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"Let's focus on digits 3 and 5, which seem to overlap a lot."
|
"Let's focus on digits 2, 3 and 5, which seem to overlap a lot."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -1951,7 +1951,7 @@
|
||||||
" plt.axis(\"off\")\n",
|
" plt.axis(\"off\")\n",
|
||||||
" ax = plt.gcf().gca() # get current axes in current figure\n",
|
" ax = plt.gcf().gca() # get current axes in current figure\n",
|
||||||
" for index, image_coord in enumerate(X_normalized):\n",
|
" for index, image_coord in enumerate(X_normalized):\n",
|
||||||
" closest_distance = np.linalg.norm(np.array(neighbors) - image_coord, axis=1).min()\n",
|
" closest_distance = np.linalg.norm(neighbors - image_coord, axis=1).min()\n",
|
||||||
" if closest_distance > min_distance:\n",
|
" if closest_distance > min_distance:\n",
|
||||||
" neighbors = np.r_[neighbors, [image_coord]]\n",
|
" neighbors = np.r_[neighbors, [image_coord]]\n",
|
||||||
" if images is None:\n",
|
" if images is None:\n",
|
||||||
|
|
Loading…
Reference in New Issue