1

What is the correct way of using the tf.keras API. Can tf.layers.* be directly replaced with tf.keras.layers(Similarly activations or loss functions)? Is it necessary to import tf.keras.backend and do set_learning_phase? This doesnt seem to be explained on the official TF docs but is mentioned in this relatively old blog post.

tangy
  • 3,056
  • 2
  • 25
  • 42
  • Yes, it is possible. I refer you to: [this question](https://stackoverflow.com/questions/47167630/use-keras-layer-in-tensorflow-code?rq=1&utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa). It even contains link to a blog that explains the compatibility. – Aechlys May 03 '18 at 16:42
  • I've linked to the blog in my question as well - The point is that that post is old and related to using `keras` directly and not `tf.keras`. My question can be thought of as whether all those instructions also apply to `tf.keras` directly and are there any related updates/restrictions? – tangy May 03 '18 at 16:45

0 Answers0