keras标准化轴参数有什么作用? [英] What does keras normalize axis argument does?
问题描述
我是深度学习的初学者,我正在研究keras中的mnist数据集.
I am a beginner in deep learning and I am working upon the mnist dataset in keras.
我用归一化为
tf.keras.utils.normalize(x_train, axis = 1)
我不明白axis参数的含义.你能帮我这个忙吗?
I don't understand what does the axis argument means. Can you help me out with this?
推荐答案
normalize函数只是执行常规规范化以提高性能:
The normalize function just performs a regular normalization to improve performance:
归一化是对原始范围内的数据进行重新缩放,因此 所有值都在0到1的范围内.
Normalization is a rescaling of the data from the original range so that all values are within the range of 0 and 1.
在另一篇文章中对axis参数有很好的解释:
There is a nice explanation of the axis argument in another post:
axis = -1的含义是什么在keras.argmax中?
例如:
您的数据具有一定的形状(19、19、5、80).这意味着:
Your data has some shape (19,19,5,80). This means:
- 轴= 0-19个元素
- 轴= 1-19个元素
- 轴= 2-5个元素
- 轴= 3-80个元素
此外,对于想深入研究的人,GitHub上的Keras的作者FrançoisChollet有一个解释:
Also, for those who want to go deeper, there is an explanation from François Chollet - Keras’ author- on GitHub:
- 对于密集层,所有RNN层和大多数其他类型的层, 默认应使用axis = -1
- 对于Convolution2D图层 如果使用dim_ordering ="th"(默认值),则使用axis = 1,
- 对于Convolution2D 具有dim_ordering ="tf"的图层,请使用axis = -1(即默认值).
- For Dense layer, all RNN layers and most other types of layers, the default of axis=-1 is what you should use,
- For Convolution2D layers with dim_ordering="th" (the default), use axis=1,
- For Convolution2D layers with dim_ordering="tf", use axis=-1 (i.e. the default).
https://github.com/fchollet/keras/issues/1921
这篇关于keras标准化轴参数有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!