简体   繁体   English

如何反向批量归一化

[英]How to reverse batch normalization

In a regression network, I would like to use batch normalization on the objective y to obtain y_norm to fit.在回归网络中,我想对目标y使用批量归一化以获得适合的y_norm Because y_norm is well distributed.因为y_norm分布良好。

In testing stage after training, I need to "undo" a batch normalization on the predicted y_norm .在训练后的测试阶段,我需要“撤消”对预测的y_norm的批量归一化。 Is there any elegant way in tensorflow/keras in which I can construct an "undo" layer from the origin BN layer?在 tensorflow/keras 中有什么优雅的方法可以从原始 BN 层构造一个“撤消”层吗?

I have found that this layer has 2 methods: inverse() which performs the normalization and forward() which performs the de-normalization.我发现层有两种方法:执行规范化的inverse()和执行反规范化的forward() So, in training you should use inverse and in inference the forward method.因此,在训练中您应该使用inverse方法并在推理中使用forward方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM