我正在和theano类型的人做斗争。
我在Keras中创建了一些Sequential模型,其中最后一层是
final_model.add(Dense(1, activation='sigmoid'))
当我尝试的时候
final_model.get_output([x,x])
>>> sigmoid.0
如何获取实际的输出值?我试着使用output.eval()。output[0][0].eval(),但这只会导致
theano.gof.fg.MissingInputError: ("An input of the graph, used to com
我的Keras模型是Keras存储库中的。
我希望在数据集中获得模型的输出(以文字表示)。
我试过:
layer = model.layers[-1] # For the last layer
f = K.function([model.get_input(train=False)], [layer.get_output(train=False)])
print(f([x])[0]) # your activation tensor
但我知道错误是:
AttributeError: 'Sequential' object has no attribute
我在石油天然气行业工作。
我一直试图建立一个具有协变量的ts预测模型,模型R代码如下:
#Getting R libraries:
library(readxl)
library(ggplot2)
library(forecast)
library(timeSeries)
library(tseries)
library(MTS)
#Create a time series object:
myts <- ts(dataset, start = c(2005,1), end = c(2019,12), frequency = 12)
#Illustrate out of sample
我有一个推理脚本,其中负载模型和预测在一个脚本中,如何将它们分开,这样我就不必在每次进行预测时都加载模型
from keras.models import load_model
# load model
model = load_model('model.h5')
# prediction
result = model.predict(image)