Skip to content

Use theano.tensor.switch instead of pm.switch #325

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

Merged
merged 1 commit into from
Oct 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Chapter1_Introduction/Ch1_Introduction_PyMC3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@
"source": [
"with model:\n",
" idx = np.arange(n_count_data) # Index\n",
" lambda_ = tt.switch(tau >= idx, lambda_1, lambda_2)"
" lambda_ = pm.math.switch(tau >= idx, lambda_1, lambda_2)"
]
},
{
Expand Down
14 changes: 7 additions & 7 deletions Chapter2_MorePyMC/Ch2_MorePyMC_PyMC3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,11 @@
"outputs": [],
"source": [
"import numpy as np\n",
"\n",
"n_data_points = 5 # in CH1 we had ~70 data points\n",
"idx = np.arange(n_data_points)\n",
"with model:\n",
" lambda_ = pm.switch(tau >= idx, lambda_1, lambda_2)"
" lambda_ = pm.math.switch(tau >= idx, lambda_1, lambda_2)"
]
},
{
Expand Down Expand Up @@ -384,7 +385,6 @@
}
],
"source": [
"import numpy as np\n",
"import theano.tensor as tt\n",
"\n",
"with pm.Model() as theano_test:\n",
Expand Down Expand Up @@ -2646,21 +2646,21 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python 2",
"display_name": "Python 3",
"language": "python",
"name": "python2"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.11"
"pygments_lexer": "ipython3",
"version": "3.5.2"
}
},
"nbformat": 4,
Expand Down