Tensorflow tf.layers
生活随笔
收集整理的这篇文章主要介绍了
Tensorflow tf.layers
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
import tensorflow as tf
复制代码/anaconda3/envs/py35/lib/python3.5/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.from ._conv import register_converters as _register_converters
复制代码 inputs = tf.placeholder(tf.float32, [None, 10])
复制代码output = tf.layers.dense(inputs, 1)
复制代码output.get_shape()
复制代码TensorShape([Dimension(None), Dimension(1)])
复制代码 inputs = tf.placeholder(tf.float32, [None, 32, 32, 3])
复制代码output = tf.layers.conv2d(inputs, 64, 5)
复制代码output.get_shape()
复制代码TensorShape([Dimension(None), Dimension(28), Dimension(28), Dimension(64)])
复制代码 output = tf.layers.conv2d(inputs, 64, 5, strides=(2,2), padding='same')
复制代码output.get_shape()
复制代码TensorShape([Dimension(None), Dimension(16), Dimension(16), Dimension(64)])
复制代码 out2 = tf.layers.max_pooling2d(output, 2, 2)
复制代码out2.get_shape()
复制代码TensorShape([Dimension(None), Dimension(8), Dimension(8), Dimension(64)])
复制代码
总结
以上是生活随笔为你收集整理的Tensorflow tf.layers的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: VC++读取AVi视频文件
- 下一篇: js:封装获取当前元素的所有的哥哥元素节