analyse_orderless_NADE.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:NADE 作者: MarcCote 项目源码 文件源码
def plot_RF(rf, sample_shape):
    norm = matplotlib.colors.Normalize()
    norm.autoscale(rf)
    rf = np.resize(rf, np.prod(sample_shape)).reshape(sample_shape)
    norm_zero = min(max(norm(0.0), 0.0+1e-6), 1.0-1e-6)
    cdict = {
             'red'  :  ((0., 0., 0.), (norm_zero, 0.5, 0.5), (1., 1., 1.)),
             'green':  ((0., 0., 0.), (norm_zero, 0.5, 0.5), (1., 1., 1.)),
             'blue' :  ((0., 0., 0.), (norm_zero, 0.5, 0.5), (1., 1., 1.))
             }
    #generate the colormap with 1024 interpolated values
    my_cmap = matplotlib.colors.LinearSegmentedColormap('my_colormap', cdict, 1024)                
    plt.imshow(rf, interpolation='nearest', origin='upper', cmap=my_cmap)   
    ax = plt.gca()
    ax.xaxis.set_visible(False)
    ax.yaxis.set_visible(False)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号