lanl / SEPIA

Simulation-Enabled Prediction, Inference, and Analysis: physics-informed statistical learning.
Other
29 stars 6 forks source link

Prediction dimensions #1

Closed granthutchings closed 4 years ago

granthutchings commented 4 years ago

I passed an x_pred with incorrect dimensions and it crashed.

ValueError Traceback (most recent call last)

in 2 x_pred=np.linspace(0,1,9) 3 pred_samples=model.get_samples(numsamples=7) ----> 4 pred=SepiaFullPrediction(x_pred, pred_samples, model) 5 6 plt.figure() ~/Documents/LANL/SEPIA/sepia/SepiaPredict.py in __init__(self, *args, **kwrds) 110 super(SepiaFullPrediction,self).__init__(*args,**kwrds) 111 # prediction is samples x prediction points x pu or pv (basis) --> 112 uvPred(self) 113 114 def get_u_v(self): ~/Documents/LANL/SEPIA/sepia/SepiaPredict.py in uvPred(pred, useAltW) 285 xzDist=SepiaDistCov(xtheta,data.zt) 286 xpredDist=SepiaDistCov(xpredt) --> 287 xxpredDist=SepiaDistCov(xtheta,xpredt) 288 zxpredDist=SepiaDistCov(data.zt,xpredt) 289 ~/Documents/LANL/SEPIA/sepia/SepiaDistCov.py in __init__(self, data, data2, catInd) 25 self.m = data2.shape[0] 26 self.ind = np.unravel_index(np.arange(self.n * self.m), (self.n, self.m)) ---> 27 self.sqdist = np.square(data[self.ind[0], :] - data2[self.ind[1], :]) 28 29 def compute_cov_mat(self, beta, lamz, lams=None, verbose=False): ValueError: operands could not be broadcast together with shapes (36,4) (36,3)
jgattiker commented 4 years ago

New checks are more informative about the (in-)validity of matrices passed in to SepiaPredict.