gpt4 book ai didi

machine-learning - variable_ops_scope和variable_scope有什么区别?

转载 作者:行者123 更新时间:2023-11-30 09:10:52 26 4
gpt4 key购买 nike

在 TensorFlow 中,有两个作用域函数:variable_ops_scopevariable_scope。第一个签名如下:

variable_op_scope(values, name_or_scope, default_name,initializer, 
regularizer, caching_device, partitioner, reuse)

第一个参数values是什么意思? default_name仅在name_or_scopeNone时使用,那么为什么这个函数需要采用这两个参数呢?一个参数就足够了。

一般来说,这两个范围有什么区别?

最佳答案

variable_ops_scopevariable_scope 的包装器。就像 tf.variable_scope 一样,但还执行 2 件事:

  1. 验证值是否来自同一图表

  2. 如果 name_or_scopeNone,则将使用 default_name,并且在需要时将进行唯一化。请注意,如果 name_or_scope 不是 None,则会使用它,但不会唯一化,并且 default_name 将不会使用。

关于machine-learning - variable_ops_scope和variable_scope有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38841380/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com