What is the difference between tf.keras.layers versus tf.layers?

后端 未结 3 875
甜味超标
甜味超标 2021-01-04 21:01

What is the difference between tf.keras.layers versus tf.layers?
E.g. both of them have Conv2d, do they provide different outputs?
Is there any benefits if you mix

3条回答
  •  滥情空心
    2021-01-04 21:35

    tf.keras.layers.Conv2d is a tensorflow-keras layer while tf.layers.max_pooling2d is a tensorflow 'native layer'

    You cannot use a native layer directly within a Keras model, as it will be missing certain attributes required by the Keras API.

    However, it is possible to use native layer if wrapped within a tensorflow-keras Lambda layer. A link to the documentation for this is below.

    https://www.tensorflow.org/api_docs/python/tf/keras/layers/Lambda

提交回复
热议问题