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)
评论列表
文章目录