如何在Keras中对整个模型进行权重归一化?

2024-05-04 05:40:56 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个巨大的模型,有很多组成层,每个层都有W_正则化器=l2(0.01)参数。我想从每个层声明中删除它,并将其作为一个整体应用于模型。有可能在Keras上这样做吗?在


Tags: 模型声明参数keras整体化器正则l2
1条回答
网友
1楼 · 发布于 2024-05-04 05:40:56

看起来不像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.

相关问题 更多 >