Once the training is done show the plot of weights using the Matplotlib library using code listing:
print("Total cost: " + str(autoencoder.calc_total_cost(X_test)))wts = autoencoder.getWeights()dim = math.ceil(math.sqrt(autoencoder.n_hidden))plt.figure(1, figsize=(dim, dim))for i in range(0, autoencoder.n_hidden): im = wts.flatten()[i::autoencoder.n_hidden].reshape((28, 28)) ax = plt.subplot(dim, dim, i + 1) for label in (ax.get_xticklabels() + ax.get_yticklabels()): label.set_fontname('Arial') label.set_fontsize(8) # plt.title('Feature Weights ' + str(i)) plt.imshow(im, cmap="gray", clim=(-1.0, 1.0))plt.suptitle('Basic AutoEncoder Weights', fontsize=15, y=0.95)#plt.title("Test Title", y=1.05)plt.savefig( ...