...
 
Commits (3)
......@@ -739,7 +739,7 @@
"pred_probs_padded_ups = np.repeat(pred_probs_padded_ups, repeats=???, axis=3)\n",
"print(\"Plotting image after repetition....................\")\n",
"plot_image(pred_probs_padded_ups[0,real_lbl,:,:], cmap=\"bwr\")\n",
"print(\"Upsampled image after repetition has shape:\", pred_probs_padded_ups.shape) # (1, 10, 33, 33)\n",
"print(\"Upsampled image after repetition has shape:\", pred_probs_padded_ups.shape) # (1, 10, 36, 36)\n",
"############################################################################################\n",
"# Convolve with uniform kernel:\n",
"kernel = np.ones([1,1,4,4])/16.\n",
......
......@@ -362,14 +362,14 @@
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.mlab as mlab\n",
"from scipy.stats import norm\n",
"\n",
"def plot_gmm(x, gmm):\n",
" omega = gmm.weights_\n",
" mu = gmm.means_\n",
" sigma = np.sqrt(gmm.covariances_)\n",
" for ind in range(0,omega.shape[0]): \n",
" plt.plot(x,omega[ind]*mlab.normpdf(x, mu[ind], sigma[ind]), linewidth=2, label='GMM Component '+str(ind))\n",
" plt.plot(x,omega[ind]*norm.pdf(x, mu[ind], sigma[ind]), linewidth=2, label='GMM Component '+str(ind))\n",
"\n",
"plt.figure(figsize=(10, 4), dpi=100)\n",
"plt.hist(X, bins=num_bins, density=True, range=(lim_low, lim_high), label='Intensity histogram', color='lightgray');\n",
......