variable_ops_scope和variable_scope有什么区别? [英] What is the difference between variable_ops_scope and variable_scope?

查看:104
本文介绍了variable_ops_scope和variable_scope有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在TensorFlow中,有两个范围函数:variable_ops_scopevariable_scope.第一个签名如下:

In TensorFlow, there are two scope functions: variable_ops_scope and variable_scope. The first one has a signature as following:

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

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

What does the first parameter values mean? default_name is only used when name_or_scope is None, so why this function need to take these two parameters? One parameter should be enough.

通常,这两个范围有什么区别?

In general, what is the difference between these two scopes?

推荐答案

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

variable_ops_scope is a wrapper for variable_scope. Just like tf.variable_scope, but performs 2 more things:

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

  1. Validate that values come from the same graph

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

If name_or_scope is None, the default_name will be used and will be uniquified if needed. Note that, if name_or_scope is not None, it will be used and but not be uniquified, and default_name will not be used.

这篇关于variable_ops_scope和variable_scope有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆