-
-
Notifications
You must be signed in to change notification settings - Fork 269
Update VI Bayesian NN notebook to best practices #221
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
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
View / edit / reply to this conversation on ReviewNB chiral-carbon commented on 2021-09-01T15:02:46Z I commented this out for now, but would we require it when we are already setting the seed in the beginning? OriolAbril commented on 2021-09-08T15:56:09Z rng = np.random.default_rng(RANDOM_SEED)
only sets the seed of
This is one of the main reasons that the chiral-carbon commented on 2021-09-09T08:38:12Z oh okay. in thats case I do get an error here, ImportError: cannot import name 'MRG_RandomStreams' from 'pymc3.theanof' I think it is because of compatibility issues between pymc3 >= 3.10 and theano? OriolAbril commented on 2021-09-09T11:01:47Z It looks like it could be fixed with a call to |
rng = np.random.default_rng(RANDOM_SEED)
only sets the seed of
This is one of the main reasons that the View entire conversation on ReviewNB |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-09-08T15:59:13Z Line #3. ax.scatter(X[Y == 1, 0], X[Y == 1, 1], color="C3", label="Class 1") I personally prefer c0-c1 as it has more contrast, but both options are fine |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-09-08T15:59:14Z Line #12. "train_cols": np.arange(len(X[:][0])), I would keep the |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-09-08T15:59:14Z Line #42. out = pm.Bernoulli( this should also have the dimensions annotated chiral-carbon commented on 2021-09-09T08:58:58Z what dimension would this have though?
OriolAbril commented on 2021-09-09T11:10:17Z coords = { "hidden_layer_1": np.arange(n_hidden), "hidden_layer_2": np.arange(n_hidden), "train_col": np.arange(X.shape[1]), "obs_id": np.arange(X.shape[0]) }
I'd do something like that. Here the number of nodes in each layer are independent, yet coincidentally the same so i'd not use |
View / edit / reply to this conversation on ReviewNB OriolAbril commented on 2021-09-08T15:59:15Z format with less digits, 3-4 at the very most I'd say. 1-2 already perfectly fine |
oh okay. in thats case I do get an error here, ImportError: cannot import name 'MRG_RandomStreams' from 'pymc3.theanof' I think it is because of compatibility issues between pymc3 >= 3.10 and theano? View entire conversation on ReviewNB |
what dimension would this have though?
View entire conversation on ReviewNB |
It looks like it could be fixed with a call to View entire conversation on ReviewNB |
coords = { "hidden_layer_1": np.arange(n_hidden), "hidden_layer_2": np.arange(n_hidden), "train_col": np.arange(X.shape[1]), "obs_id": np.arange(X.shape[0]) }
I'd do something like that. Here the number of nodes in each layer are independent, yet coincidentally the same so i'd not use View entire conversation on ReviewNB |
View / edit / reply to this conversation on ReviewNB Sayam753 commented on 2021-09-10T20:44:03Z I think the problem lies here - coords = { "hidden_layer_1": np.arange(n_hidden), "hidden_layer_2": np.arange(n_hidden), "train_col": np.arange(X.shape[1]), "obs_id": np.arange(X.shape[0]) } X has shape (1000, 2), but X_train has shape (500, 2). It is X_train that we use for training.
So, the right coords will be - coords = { "hidden_layer_1": np.arange(n_hidden), "hidden_layer_2": np.arange(n_hidden), "train_col": np.arange(X_train.shape[1]), "obs_id": np.arange(X_train.shape[0]) } I wonder what will happen if we pass X_test of shape not of shape (500, 2), but something else, like (400, 2) :thinking_face:
Sayam753 commented on 2021-09-10T20:56:31Z Minor nitpick - Looking at the warning, @OriolAbril do we promote plotting trace in PyMC3's model context? OriolAbril commented on 2021-09-10T22:37:42Z Right, because the original code uses
No, plotting should not happen inside the model context. The warning is because we are giving ArviZ a non InferenceData input, so it first has to convert to idata. It's the conversion what should happen inside the model context, and it should be explicit. After that, plotting will work without warnings outside the model context. |
Minor nitpick - Looking at the warning, @OriolAbril do we promote plotting trace in PyMC3's model context? View entire conversation on ReviewNB |
Right, because the original code uses
No, plotting should not happen inside the model context. The warning is because we are giving ArviZ a non InferenceData input, so it first has to convert to idata. It's the conversion what should happen inside the model context, and it should be explicit. After that, plotting will work without warnings outside the model context. View entire conversation on ReviewNB |
View / edit / reply to this conversation on ReviewNB Sayam753 commented on 2021-09-19T03:22:58Z How do I interpret the output of this cell? OriolAbril commented on 2021-10-13T05:04:40Z this is a forgotten debug print that made it to the arviz release, rerunning with 0.11.4 will get rid of this message |
this is a forgotten debug print that made it to the arviz release, rerunning with 0.11.4 will get rid of this message View entire conversation on ReviewNB |
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.
LGTM
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.
I'd also suggest rerunning with latest arviz to get rid of those debug prints. But at the very least it needs to include the post directive. It should not be merged without it
d48a348
to
292bf13
Compare
bde4a7b
to
d4afe49
Compare
@OriolAbril I have fixed all the broken links, I think this could be merged now |
There is still a broken ADVI link in the summary section. |
In the next steps section, should I add a line where Theano is mentioned about it being continued as Aesara? |
we can directly update theano to aesara when running with v4 |
Addresses issue #131 and aims to advance it to best practices