mindspore/docs/api/api_python/ops/mindspore.ops.ApplyGradient...

28 lines
1.2 KiB
ReStructuredText
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.ApplyGradientDescent
===================================
.. py:class:: mindspore.ops.ApplyGradientDescent
通过从 `var` 中减去 `alpha` * `delta` 来更新 `var`
.. math::
var = var - \alpha * \delta
其中 :math:`\alpha` 代表 `alpha` :math:`\delta` 代表 `delta`
`var``delta` 的输入遵循隐式类型转换规则,使数据类型一致。如果它们具有不同的数据类型,则低精度数据类型将转换为相对最高精度数据类型。
输入:
- **var** (Parameter) - 要更新的变量为任意维度其数据类型为float32或float16。
- **alpha** (Union[Number, Tensor]) - 调节系数必须是Scalar。数据类型为float32或float16。
- **delta** (Tensor) - 变化的Tensorshape和数据类型与 `var` 相同。
输出:
Tensor更新后的 `var`
异常:
- **TypeError** - 如果 `var``alpha` 的数据类型既不是float16也不是float32。
- **TypeError** - 如果 `delta` 不是Tensor。
- **TypeError** - 如果 `alpha` 既不是数值型也不是Tensor。
- **RuntimeError** - 如果不支持 `var``delta` 数据类型转换。