Skip to content

Commit

Permalink
Merge pull request CamDavidsonPilon#325 from sebp/fix-pymc3-switch
Browse files Browse the repository at this point in the history
Use theano.tensor.switch instead of pm.switch
  • Loading branch information
CamDavidsonPilon authored Oct 18, 2016
2 parents c4f498f + 824d047 commit 0413e0f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
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

0 comments on commit 0413e0f

Please sign in to comment.