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
tf.layers
module is Tensorflow attempt at creating a Keras like API whereas tf.keras.layers
is a compatibility wrapper. In fact, most of the implementation refers back to tf.layers
, for example the tf.keras.layers.Dense
inherits the core implementation:
@tf_export('keras.layers.Dense')
class Dense(tf_core_layers.Dense, Layer):
# ...
Because the tf.keras
compatibility module is checked into the Tensorflow repo separately, it might lack behind what Keras actually offers. I would use Keras directly or tf.layers
but not necessarily mix them.