Tensorflow's tensorflow variable_scope values parameter meaning

前端 未结 1 1384
[愿得一人]
[愿得一人] 2020-12-21 03:50

I am currently reading a source code for slim library that is based on Tensorflow and they use values argument for variable_scope method alot, like

1条回答
  •  礼貌的吻别
    2020-12-21 04:20

    The variable_scope parameter helps ensure uniqueness of variables and reuse of variables where desired.

    Yes if you create two or more different computation graphs then they wouldn't necessarily share the same variable scope; however, there are ways to get them to be shared across graphs so the option is there.

    Primary use cases for variable scope are for RNN's where many of the weights are tied and reused. That's one reason someone would need it. The other main reason it's there is to ensure that you are reusing the same variables when you explicitly mean to and not by accident. (For distributed settings this can become a concern.)

    0 讨论(0)
提交回复
热议问题