The backend learning phase affects any code that calls
backend.learningphase()
In particular, all Keras built-in layers use the learning phase as the default
for the training arg to <a href="../../../tf/keras/layers/Layer#call">Layer.call_.
User-written layers and models can achieve the same behavior with code that
looks like:
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.keras.backend.set_learning_phase\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/keras/backend/set_learning_phase) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.3.0/tensorflow/python/keras/backend.py#L398-L426) |\n\nSets the learning phase to a fixed value. (deprecated)\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.keras.backend.set_learning_phase`](/api_docs/python/tf/keras/backend/set_learning_phase)\n\n\u003cbr /\u003e\n\n tf.keras.backend.set_learning_phase(\n value\n )\n\n| **Warning:** THIS FUNCTION IS DEPRECATED. It will be removed after 2020-10-11. Instructions for updating: Simply pass a True/False value to the `training` argument of the `__call__` method of your layer or model.\n\nThe backend learning phase affects any code that calls\n[`backend.learning`*phase()*](../../../tf/keras/backend/learning_phase)*In particular, all Keras built-in layers use the learning phase as the default\nfor the `training` arg to \\\u003ca href=\"../../../tf/keras/layers/Layer#* *call* *\"\\\u003e`Layer.`* *call*`_`.\n\nUser-written layers and models can achieve the same behavior with code that\nlooks like: \n\n def call(self, inputs, training=None):\n if training is None:\n training = backend.learning_phase()\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Arguments --------- ||\n|---------|---------------------------------------------------------------------|\n| `value` | Learning phase value, either 0 or 1 (integers). 0 = test, 1 = train |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|------------------------------------|\n| `ValueError` | if `value` is neither `0` nor `1`. |\n\n\u003cbr /\u003e"]]