-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Added functionality for retrieving variables from control dependencies #220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# Tests if all variables are properly retrieved, 2 variables and 2 momentum | ||
# variables. | ||
self.assertEqual(len(net_vars.variables.items()), 4) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also call get_weights
and set_weights
and make sure those methods work in this case? (you'll probably need to call init as well).
if op.node_def.op == "Variable": | ||
variable_names.append(op.node_def.name) | ||
tf_obj = queue.popleft() | ||
if hasattr(tf_obj, "op"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if statement is a bit confusing to me, why are we doing this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's the right thing to do, could you document why?
We also need to change |
prefix = str(uuid.uuid1().hex) | ||
# Use the tensorflow variable_scope to prefix all of the variables | ||
with tf.variable_scope(prefix): | ||
# Use a seperate graph for each network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seperate -> separate
This functionality is primarily for passing in
opt.minimize
as the loss function toTensorFlowVariables
, and now no longer has the prefixing.