Skip to content
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

Gradient flowing between inference_cell and generator_cell #42

Open
Rustleman opened this issue Dec 18, 2019 · 0 comments
Open

Gradient flowing between inference_cell and generator_cell #42

Rustleman opened this issue Dec 18, 2019 · 0 comments

Comments

@Rustleman
Copy link

There seems to be an issue in the inference_rnn function where the inference_cell and generator_cell are connected together:

tf-gqn/gqn/gqn_draw.py

Lines 417 to 421 in bc84f24

# estimate statistics and sample state from posterior
mu_q, sigma_q, z_q = compute_eta_and_sample_z(inf_state.lstm.h,
scope="Sample_eta_q")
# input into generator RNN
gen_input = _GeneratorCellInput(representations, query_poses, z_q)

It looks like the gradient flows through z_q.

Adding the line z_q = tf.stop_gradient(z_q)
seems to improve the results when just the generator_rnn is used during testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant