# Reorder RBM features by average activity decreasingly rbmReordered = vis.reorder_filter_by_hidden_activation(rbm, train_data) # Display RBM parameters vis.imshow_standard_rbm_parameters(rbmReordered, v1, v2, h1, h2) # Sample some steps and show results samples = vis.generate_samples(rbm, train_data[0:30], 30, 1, v1, v2, False, None) vis.imshow_matrix(samples, 'Samples') # Get the optimal gabor wavelet frequency and angle for the filters opt_frq, opt_ang = vis.filter_frequency_and_angle(rbm.w, num_of_angles=40) # Show some tuning curves num_filters = 20 vis.imshow_filter_tuning_curve(rbm.w[:, 0:num_filters], num_of_ang=40) # Show some optima grating vis.imshow_filter_optimal_gratings(rbm.w[:, 0:num_filters], opt_frq[0:num_filters], opt_ang[0:num_filters]) # Show histograms of frequencies and angles. vis.imshow_filter_frequency_angle_histogram(opt_frq=opt_frq, opt_ang=opt_ang, max_wavelength=14) # Show all windows. vis.show()
num_tiles_y=height, border_size=1, normalized=True) vis.imshow_matrix(matrix=ica_filters, windowtitle='Filters learned by ICA') # Get the optimal gabor wavelet frequency and angle for the filters opt_frq, opt_ang = vis.filter_frequency_and_angle(ica.projection_matrix, num_of_angles=40) # Show some tuning curves num_filters = 20 vis.imshow_filter_tuning_curve(ica.projection_matrix[:,0:num_filters], num_of_ang=40) # Show some optima grating vis.imshow_filter_optimal_gratings(ica.projection_matrix[:,0:num_filters], opt_frq[0:num_filters], opt_ang[0:num_filters]) # Show histograms of frequencies and angles. vis.imshow_filter_frequency_angle_histogram(opt_frq=opt_frq, opt_ang=opt_ang, max_wavelength=14) print("log-likelihood on all data: "+str(numx.mean( ica.log_likelihood(data=whitened_data)))) # Show all windows. vis.show()