gpt4 book ai didi

python - 如何对 Keras 中的整个模型应用权重归一化?

转载 作者:太空宇宙 更新时间:2023-11-03 12:03:15 27 4
gpt4 key购买 nike

我有一个巨大的模型,其中包含许多构成层,每个构成层都具有 W_regularizer=l2(0.01) 参数。我想从每个层声明中删除它并将其作为一个整体应用于模型。可以在 Keras 上执行此操作吗?

最佳答案

看起来不像 docs

Regularizers allow to apply penalties on layer parameters or layer activity during optimization. These penalties are incorporated in the loss function that the network optimizes.

The penalties are applied on a per-layer basis. The exact API will depend on the layer, but the layers Dense, Conv1D, Conv2D and Conv3D have a unified API.

关于python - 如何对 Keras 中的整个模型应用权重归一化?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41086203/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com