29
29
import pymc as pm
30
30
31
31
from pymc .aesaraf import floatX
32
- from pymc .data import Data
32
+ from pymc .data import Data , MutableData
33
33
from pymc .distributions import (
34
34
Bernoulli ,
35
35
Beta ,
@@ -1109,7 +1109,7 @@ def perform(self, node, inputs, outputs):
1109
1109
intercept = inputs [0 ][0 ]
1110
1110
x_coeff = inputs [0 ][1 ]
1111
1111
1112
- temp = intercept + x_coeff * x + self .pymc_model .bias .get_value ()
1112
+ temp = intercept + x_coeff * x + self .pymc_model .bias .data
1113
1113
with self .pymc_model :
1114
1114
set_data ({"model_output" : temp })
1115
1115
outputs [0 ][0 ] = np .array (temp )
@@ -1120,9 +1120,9 @@ def perform(self, node, inputs, outputs):
1120
1120
1121
1121
with Model () as coarse_model_0 :
1122
1122
bias = Data ("bias" , 3.5 * np .ones (y .shape , dtype = p ))
1123
- mu_B = Data ("mu_B" , - 1.3 * np .ones (y .shape , dtype = p ))
1124
- Sigma_B = Data ("Sigma_B" , np .zeros ((y .shape [0 ], y .shape [0 ]), dtype = p ))
1125
- model_output = Data ("model_output" , np .zeros (y .shape , dtype = p ))
1123
+ mu_B = MutableData ("mu_B" , - 1.3 * np .ones (y .shape , dtype = p ))
1124
+ Sigma_B = MutableData ("Sigma_B" , np .zeros ((y .shape [0 ], y .shape [0 ]), dtype = p ))
1125
+ model_output = MutableData ("model_output" , np .zeros (y .shape , dtype = p ))
1126
1126
Sigma_e = Data ("Sigma_e" , s )
1127
1127
1128
1128
# Define priors
@@ -1140,9 +1140,9 @@ def perform(self, node, inputs, outputs):
1140
1140
1141
1141
with Model () as coarse_model_1 :
1142
1142
bias = Data ("bias" , 2.2 * np .ones (y .shape , dtype = p ))
1143
- mu_B = Data ("mu_B" , - 2.2 * np .ones (y .shape , dtype = p ))
1144
- Sigma_B = Data ("Sigma_B" , np .zeros ((y .shape [0 ], y .shape [0 ]), dtype = p ))
1145
- model_output = Data ("model_output" , np .zeros (y .shape , dtype = p ))
1143
+ mu_B = MutableData ("mu_B" , - 2.2 * np .ones (y .shape , dtype = p ))
1144
+ Sigma_B = MutableData ("Sigma_B" , np .zeros ((y .shape [0 ], y .shape [0 ]), dtype = p ))
1145
+ model_output = MutableData ("model_output" , np .zeros (y .shape , dtype = p ))
1146
1146
Sigma_e = Data ("Sigma_e" , s )
1147
1147
1148
1148
# Define priors
@@ -1161,7 +1161,7 @@ def perform(self, node, inputs, outputs):
1161
1161
# fine model and inference
1162
1162
with Model () as model :
1163
1163
bias = Data ("bias" , np .zeros (y .shape , dtype = p ))
1164
- model_output = Data ("model_output" , np .zeros (y .shape , dtype = p ))
1164
+ model_output = MutableData ("model_output" , np .zeros (y .shape , dtype = p ))
1165
1165
Sigma_e = Data ("Sigma_e" , s )
1166
1166
1167
1167
# Define priors
@@ -1268,9 +1268,9 @@ def perform(self, node, inputs, outputs):
1268
1268
1269
1269
with Model () as coarse_model_0 :
1270
1270
if aesara .config .floatX == "float32" :
1271
- Q = Data ("Q" , np .float32 (0.0 ))
1271
+ Q = MutableData ("Q" , np .float32 (0.0 ))
1272
1272
else :
1273
- Q = Data ("Q" , np .float64 (0.0 ))
1273
+ Q = MutableData ("Q" , np .float64 (0.0 ))
1274
1274
1275
1275
# Define priors
1276
1276
intercept = Normal ("Intercept" , true_intercept , sigma = 1 )
@@ -1285,9 +1285,9 @@ def perform(self, node, inputs, outputs):
1285
1285
1286
1286
with Model () as coarse_model_1 :
1287
1287
if aesara .config .floatX == "float32" :
1288
- Q = Data ("Q" , np .float32 (0.0 ))
1288
+ Q = MutableData ("Q" , np .float32 (0.0 ))
1289
1289
else :
1290
- Q = Data ("Q" , np .float64 (0.0 ))
1290
+ Q = MutableData ("Q" , np .float64 (0.0 ))
1291
1291
1292
1292
# Define priors
1293
1293
intercept = Normal ("Intercept" , true_intercept , sigma = 1 )
@@ -1302,9 +1302,9 @@ def perform(self, node, inputs, outputs):
1302
1302
1303
1303
with Model () as model :
1304
1304
if aesara .config .floatX == "float32" :
1305
- Q = Data ("Q" , np .float32 (0.0 ))
1305
+ Q = MutableData ("Q" , np .float32 (0.0 ))
1306
1306
else :
1307
- Q = Data ("Q" , np .float64 (0.0 ))
1307
+ Q = MutableData ("Q" , np .float64 (0.0 ))
1308
1308
1309
1309
# Define priors
1310
1310
intercept = Normal ("Intercept" , true_intercept , sigma = 1 )
0 commit comments