In TensorFlow, tf.layers and tf.contrib.layers share a lot of functionality (standard 2D convolutional layers, batch normalization layers, etc). Is the difference between th
You've answered your own question. The description on the official documentation for the tf.contrib namespace is:
contrib module containing volatile or experimental code.
So tf.contrib
is reserved for experimental features. APIs in this namespace are allowed to change rapidly between versions, whereas the others usually can't without a new major version. In particular, the functions in tf.contrib.layers
are not identical to those found in tf.layers
, although some of them might be replicated with different names.
As for whether you should use them, that depends on whether you are willing to handle sudden breaking changes. Code that doesn't rely on tf.contrib
may be easier to migrate to future versions of TensorFlow.