tensorflow优化器
TensorFlow-优化器 (TensorFlow - Optimizers)
Optimizers are the extended class, which include added information to train a specific model. The optimizer class is initialized with given parameters but it is important to remember that no Tensor is needed. The optimizers are used for improving speed and performance for training a specific model.
优化器是扩展类,其中包括用于训练特定模型的附加信息。 优化器类使用给定的参数初始化,但是请记住,不需要Tensor是很重要的。 优化器用于提高速度和性能,以训练特定模型。
The basic optimizer of TensorFlow is −
TensorFlow的基本优化器是-
tf.train.Optimizer
This class is defined in the specified path of tensorflow/python/training/optimizer.py.
此类在tensorflow / python / training / optimizer.py的指定路径中定义。
Following are some optimizers in Tensorflow −
以下是Tensorflow中的一些优化器-
- Stochastic Gradient descent 随机梯度下降
- Stochastic Gradient descent with gradient clipping 带有梯度剪切的随机梯度下降
- Momentum 动量
- Nesterov momentum 内斯特罗夫的势头
- Adagrad 阿达格勒
- Adadelta 阿达达
- RMSProp RMSProp
- Adam 亚当
- Adamax 阿达玛克斯
- SMORMS3 SMORMS3
We will focus on the Stochastic Gradient descent. The illustration for creating optimizer for the same is mentioned below −
我们将专注于随机梯度下降。 下面提到用于创建优化器的图示-
def sgd(cost, params, lr = np.float32(0.01)):
g_params = tf.gradients(cost, params)
updates = []
for param, g_param in zip(params, g_params):
updates.append(param.assign(param - lr*g_param))
return updates
The basic parameters are defined within the specific function. In our subsequent chapter, we will focus on Gradient Descent Optimization with implementation of optimizers.
基本参数在特定功能内定义。 在接下来的章节中,我们将重点介绍实现优化器的梯度下降优化。
翻译自: https://www.tutorialspoint.com/tensorflow/tensorflow_optimizers.htm
tensorflow优化器
本文介绍了TensorFlow中的优化器概念及其重要性,并列举了多种优化器类型,如随机梯度下降、动量优化等。此外,还提供了一个随机梯度下降优化器的实现示例。
524

被折叠的 条评论
为什么被折叠?



