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

AttributeError: module 'edward2.tensorflow' has no attribute 'interception' #582

Open
sundance91 opened this issue Dec 28, 2023 · 0 comments

Comments

@sundance91
Copy link

I am trying to use the deconfounder tutorial by David Blei: https://colab.research.google.com/github/blei-lab/deconfounder_tutorial/blob/master/deconfounder_tutorial.ipynb#scrollTo=DyCfobStxZmE. However, it is written in Tensorflow 1.x (old version of TF) as well as edward2. However, I am trying to get it refactored using Tensorflow 2.14.0 and the most recent version of edward2.

I am on the below cell block:

n_rep = 100 # number of replicated datasets we generate
holdout_gen = np.zeros((n_rep,*(x_train.shape)))

for i in range(n_rep):
b_sample = npr.normal(b_mean_inferred, b_stddv_inferred)
w_sample = npr.normal(w_mean_inferred, w_stddv_inferred)
w2_sample = npr.normal(w2_mean_inferred, w2_stddv_inferred)
z_sample = npr.normal(z_mean_inferred, z_stddv_inferred)

with ed.interception(replace_latents(b_sample, w_sample, w2_sample, z_sample)):
    generate = ppca_model(
        data_dim=data_dim, latent_dim=latent_dim,
        num_datapoints=num_datapoints, stddv_datapoints=stddv_datapoints,
        mask=np.ones(x_train.shape))

with tf.Session() as sess:
    x_generated, _ = sess.run(generate)

# look only at the heldout entries
holdout_gen[i] = np.multiply(x_generated, holdout_mask)

I am getting the below error:

AttributeError: module 'edward2.tensorflow' has no attribute 'interception'

On the ed.interception line. When I look online, it says that this method was taken out of the most recent version of edward2. Does anyone know what the alternative to ed.interception is in the current version of edward2?

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