예제 #1
0
def read_qrnn(file, inChannels, target):

    data = iciData(test_file, inChannels, target, batch_size=batchSize)

    qrnn = QRNN.load(file)
    y_pre, y_prior, y0, y, y_pos_mean = S.predict(data, qrnn, add_noise=True)

    return y_pre, y_prior, y0, y, y_pos_mean
예제 #2
0
def read_qrnn(file, inChannels, target):

    data = iciData(test_file, inChannels, target, batch_size=batchSize)

    # read QRNN
    #    file = 'qrnn_ici_%s_%s_%s_single.nc'%(depth, width, target)
    #    print (file)
    qrnn = QRNN.load(file)
    y_pre, y_prior, y0, y, y_pos_mean = S.predict(data, qrnn, add_noise=True)

    return y_pre, y_prior, y0, y, y_pos_mean
예제 #3
0
bins = np.arange(-20, 15, binstep)
iq = np.argwhere(quantiles == 0.5)[0,0]

#%% Uncertainty plot
plt.rcParams.update({'font.size': 26})
inChannels = np.array([target, 'I5V' , 'I6V', 'I7V', 'I8V', 'I9V', 'I10V', 'I11V'])
i183, = np.argwhere(inChannels == target)[0]
data = iciData("TB_ICI_test.nc", 
               inChannels, target, 
               batch_size = batchSize)  

file = 'qrnn_ici_%s_%s_%s_single.nc'%(depth, width, target)
print (file)
qrnn = QRNN.load(file)

y_pre, y_prior, y0, y, y_pos_mean = S.predict(data, qrnn, add_noise = True)
fig, ax = plt.subplots(1, 1, figsize = [8, 8])
x = np.arange(-3, 4, 1)
ii = 0
y_all = []
randomList = random.sample(range(0, 24000), 1500)
for i in randomList:
    ii +=1
#for i in ind:
    y1 = y_pre[i,  :] - y_pre[i, 3]
    y_all.append(y1)
    ax.plot(x, y1, color = colors["grey"], alpha = 0.4)
#%%
y_all = np.stack(y_all)
box1 = ax.boxplot(y_all, positions = x, showfliers=False,  widths = 0.9)
for item in ['boxes', 'whiskers', 'fliers', 'medians', 'caps']: