example_util.py 文件源码

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

项目:paysage 作者: drckf 项目源码 文件源码
def weight_norm_histogram(rbm, show_plot=False, filename=None):
    import matplotlib.pyplot as plt
    import seaborn as sns

    fig, ax = plt.subplots()
    for l in range(rbm.num_weights):
        num_inputs = rbm.weights[l].shape[0]
        norm = be.to_numpy_array(be.norm(rbm.weights[l].W(), axis=0) / sqrt(num_inputs))
        sns.distplot(norm, ax=ax, label=str(l))
    ax.legend()

    if show_plot:
        plt.show(fig)
    if filename is not None:
        fig.savefig(filename)
    plt.close(fig)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号