tf.compat.v1.tpu.experimental.StochasticGradientDescentParameters
Параметры оптимизации градиентного спуска для встраивания TPU.
tf.compat.v1.tpu.experimental.StochasticGradientDescentParameters(
learning_rate, clip_weight_min=None, clip_weight_max=None,
weight_decay_factor=None, multiply_weight_decay_factor_by_learning_rate=None
)
Передайте это в tf.estimator.tpu.experimental.EmbeddingConfigSpec через аргумент optimization_parameters, чтобы установить оптимизатор и его параметры. См. документацию для tf.estimator.tpu.experimental.EmbeddingConfigSpec для получения более подробной информации.
estimator = tf.estimator.tpu.TPUEstimator(
...
embedding_config_spec=tf.estimator.tpu.experimental.EmbeddingConfigSpec(
...
optimization_parameters=(
tf.tpu.experimental.StochasticGradientDescentParameters(0.1))))
| Аргументы | |
|---|---|
learning_rate | значение с плавающей точкой. Скорость обучения. |
clip_weight_min | минимальное значение для обрезки; None означает -бесконечность. |
clip_weight_max | максимальное значение для обрезки; None означает +бесконечность. |
weight_decay_factor | величина распада веса; None означает, что веса не распадаются. |
weight_decay_factor | если True, weight_decay_factor умножается на текущую скорость обучения. |
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.3/api_docs/python/tf/compat/v1/tpu/experimental/StochasticGradientDescentParameters