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视频文件
- 下一篇: SQL进阶随笔--case用法(一)