tensorflow的权归一层
tfwn的Python项目详细描述
Tfwn
Weight NormalizationTensorFlow Keras API的层包装器。
灵感来自Sean Morgan实现,但是:
- 没有数据初始化(在原始拉取请求中只实现了紧急模式)。
- 代码重构
- 更多测试
- CIFAR10重新实现的原始纸张示例
示例
不幸的是,我无法在批处理大小为100的cifar10上复制更精确的结果。 如你所见,准确度没有太大差别。
但是,对于小批量的模型,权重归一化要比常规模型好得多。
如何使用
importtensorflowastffromtfwnimportWeightNormdense_wn=WeightNorm(tf.keras.layers.Dense(3))out=dense_wn(input)
参考文献
权重规范化:一个简单的重新参数化,以加速深层神经网络的训练
蒂姆·萨利曼斯和迪德里克·P·金马。
@inproceedings{Salimans2016WeightNorm,
title={Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks},
author={Tim Salimans and Diederik P. Kingma},
booktitle={Neural Information Processing Systems 2016},
year={2016}
}