Skip to content

Commit 0413e0f

Browse files
Merge pull request #325 from sebp/fix-pymc3-switch
Use theano.tensor.switch instead of pm.switch
2 parents c4f498f + 824d047 commit 0413e0f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Chapter1_Introduction/Ch1_Introduction_PyMC3.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@
678678
"source": [
679679
"with model:\n",
680680
" idx = np.arange(n_count_data) # Index\n",
681-
" lambda_ = tt.switch(tau >= idx, lambda_1, lambda_2)"
681+
" lambda_ = pm.math.switch(tau >= idx, lambda_1, lambda_2)"
682682
]
683683
},
684684
{

Chapter2_MorePyMC/Ch2_MorePyMC_PyMC3.ipynb

+7-7
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,11 @@
330330
"outputs": [],
331331
"source": [
332332
"import numpy as np\n",
333+
"\n",
333334
"n_data_points = 5 # in CH1 we had ~70 data points\n",
334335
"idx = np.arange(n_data_points)\n",
335336
"with model:\n",
336-
" lambda_ = pm.switch(tau >= idx, lambda_1, lambda_2)"
337+
" lambda_ = pm.math.switch(tau >= idx, lambda_1, lambda_2)"
337338
]
338339
},
339340
{
@@ -384,7 +385,6 @@
384385
}
385386
],
386387
"source": [
387-
"import numpy as np\n",
388388
"import theano.tensor as tt\n",
389389
"\n",
390390
"with pm.Model() as theano_test:\n",
@@ -2646,21 +2646,21 @@
26462646
"metadata": {
26472647
"anaconda-cloud": {},
26482648
"kernelspec": {
2649-
"display_name": "Python 2",
2649+
"display_name": "Python 3",
26502650
"language": "python",
2651-
"name": "python2"
2651+
"name": "python3"
26522652
},
26532653
"language_info": {
26542654
"codemirror_mode": {
26552655
"name": "ipython",
2656-
"version": 2
2656+
"version": 3
26572657
},
26582658
"file_extension": ".py",
26592659
"mimetype": "text/x-python",
26602660
"name": "python",
26612661
"nbconvert_exporter": "python",
2662-
"pygments_lexer": "ipython2",
2663-
"version": "2.7.11"
2662+
"pygments_lexer": "ipython3",
2663+
"version": "3.5.2"
26642664
}
26652665
},
26662666
"nbformat": 4,

0 commit comments

Comments
 (0)