model_utils.py 文件源码

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

项目:ECNN 作者: alazareva 项目源码 文件源码
def update_layer_value_probs(bottom, top, cls):
    """Updates the probability distribution parameters for layer sizes.

    Keyword arguments:
    bottom -- the low performing models
    top -- the high performing models
    cls -- the layer utilities class corresponding to Concolutional Layers or Dense Layers
    """

    top = [cls.get_average_layer_size(model) for model in top if cls.has_layers(model)]
    bottom = [cls.get_average_layer_size(model) for model in bottom if cls.has_layers(model)]
    if top and bottom:
        _, p = stats.ttest_ind(top, bottom)
        if p < 0.05:
            top_mean = np.mean(top)
            bottom_mean = np.mean(bottom)
            print('adjusting parama', cls)
            if top_mean < bottom_mean:
                cls.beta += 2
            else:
                cls.alpha += 2
            print(cls.beta, cls.alpha)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号