[英]Extract fitted output from the trained model in Python (KERAS/TensorFlow)
I'm using KERAS with TensorFlow back-end. 我正在使用带有TensorFlow后端的KERAS。 Suppose that this is the model block:
假设这是模型块:
model.add(LSTM(units = 60, activation = 'tanh')
model.add(Dropout(rate = 0.5))
model.add(Dense(units = 1, activation = 'sigmoid'))
model.compile(optimizer = 'adam', loss = 'mse')
model.fit(X_train, Y_train, epochs = 200, batch_size = 32)
Is there any way to extract fitted output from the trained model ( model
)? 有什么办法来提取从训练模型(拟合输出
model
)?
You should probably rephrase you question, as it is not clear what fitted output you try to achieve. 您可能应该重新表述您的问题,因为尚不清楚您尝试实现什么合适的输出。 I guess the most probable scenarios with respect to machine learning is that:
我猜想与机器学习有关的最可能场景是:
X
, and want to do a prediction with your fitted model. X
,并希望使用拟合模型进行预测。 This can be done like this model.predict(X)
. model.predict(X)
这样完成。 model.get_weights()
. model.get_weights()
这样完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.