Spec-Zone.ru › TensorFlow

tf.keras.ops.stop_gradient

Останавливает вычисление градиента.

tf.keras.ops.stop_gradient(
    variable
)
Аргументы
variable Переменная тензора, для которого вычисление градиента должно быть отключено.
Возвращаемое значение
Переменная с отключенным вычислением градиента.

Примеры:

var = keras.backend.convert_to_tensor(
    [1., 2., 3.],
    dtype="float32"
)
var = keras.ops.stop_gradient(var)

© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/keras/ops/stop_gradient

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API