tf.minimize

简介:
minimize(self, loss, global_step=None, var_list=None, gate_gradients=1, aggregation_method=None, colocate_gradients_with_ops=False, name=None, grad_loss=None)
Add operations to minimize `loss` by updating `var_list`.
This method simply combines calls `compute_gradients()` and
`apply_gradients()`. If you want to process the gradient before applying
them call `compute_gradients()` and `apply_gradients()` explicitly instead
of using this function.
Args:
loss: A `Tensor` containing the value to minimize.
global_step: Optional `Variable` to increment by one after the
variables have been updated.
var_list: Optional list or tuple of `Variable` objects to update to
minimize `loss`. Defaults to the list of variables collected in
the graph under the key `GraphKeys.TRAINABLE_VARIABLES`.
gate_gradients: How to gate the computation of gradients. Can be
`GATE_NONE`, `GATE_OP`, or `GATE_GRAPH`.
aggregation_method: Specifies the method used to combine gradient terms.
Valid values are defined in the class `AggregationMethod`.
colocate_gradients_with_ops: If True, try colocating gradients with
the corresponding op.
name: Optional name for the returned operation.
grad_loss: Optional. A `Tensor` holding the gradient computed for `loss`.
Returns:
An Operation that updates the variables in `var_list`. If `global_step`
was not `None`, that operation also increments `global_step`.
目录
相关文章
|
8月前
|
机器学习/深度学习 PyTorch API
Torch
Torch是一个用于构建深度学习模型的开源机器学习库,它基于Lua编程语言。然而,由于PyTorch的出现,现在通常所说的"torch"指的是PyTorch。PyTorch是一个基于Torch的Python库,它提供了一个灵活而高效的深度学习框架。
146 1
|
10月前
|
机器学习/深度学习 PyTorch 算法框架/工具
torch中如何将tensor([[1, 2, 3]]) 和 tensor([4]) 合并成 tensor([[1,2,3,4]])
可以使用 torch.cat() 方法将两个张量沿着指定的维度进行拼接
383 0
|
机器学习/深度学习 PyTorch 算法框架/工具
PyTorch中 torch.nn与torch.nn.functional的区别
PyTorch中 torch.nn与torch.nn.functional的区别
195 2
|
TensorFlow 算法框架/工具
TensorFlow教程(6) tf.Variable() 和tf.get_variable()
TensorFlow教程(6) tf.Variable() 和tf.get_variable()
152 0
|
定位技术 内存技术
TF 卡是什么
TF 卡是什么
398 0
|
TensorFlow 算法框架/工具 机器学习/深度学习
【TensorFlow】tf.nn.softmax_cross_entropy_with_logits的用法
在计算loss的时候,最常见的一句话就是 tf.nn.softmax_cross_entropy_with_logits ,那么它到底是怎么做的呢? 首先明确一点,loss是代价值,也就是我们要最小化的值 tf.
1384 0
|
算法
TF-IDF
TF为"词频",IDF为"逆文档频率",将这两个值相乘,就得到了一个词的TF-IDF值。某个词对文章的重要性越高,它的TF-IDF值就越大。所以,排在最前面的几个词,就是这篇文章的关键词。
1517 0

热门文章

最新文章