tf.Variable、tf.get_variable的区别
- tf.Variable
用于生成一个初始值为initial-value的变量。
必须指定初始化值 - tf.get_variable
获取已存在的变量(要求不仅名字,而且初始化方法等各个参数都一样),如果不存在,就新建一个。
可以用各种初始化方法,不用明确指定值。
变量共享: tf.get_variable() 要配合reuse和tf.variable_scope() 使用,可以实现变量共享。
tf.Variable、tf.get_variable、tf.variable_scope以及tf.name_scope关系
https://www.cnblogs.com/MY0213/p/9270864.html
其中的几个观点:
1、tf.Variable、tf.get_variable的区别
2、tf.get_variable与tf.variable_scope配合实现reuse
3、tf.get_variable函数不受tf.name_scope的影响。