简体   繁体   English

如何获得我的班级预测LSTM Keras

[英]How to get my class prediction LSTM Keras

I recently trying to build a program, that classify Quora (question pair) dataset, whether it's duplicate or not. 我最近尝试构建一个程序,对Quora(问题对)数据集进行分类,无论它是否重复。 I got the accuracy and loss based on real y, but IDK how to proceed the output (predicted y) can anyone help me? 我得到了基于真实y的准确性和损失,但是IDK如何进行输出(预测y),有人可以帮助我吗? the output shud be 1 or 0 (binary class) 输出shud是1或0(二进制类)

This is the sentence merger code, training process use LSTM 这是句子合并代码,培训过程使用LSTM

merged = RNN(EMBED_HIDDEN_SIZE)(merged)

merged = layers.Dropout(dropoutp)(merged)
preds = layers.Dense(answer_size, activation='sigmoid')(merged)

model = Model([questiona, questionb], preds)

rmsprop = keras.optimizers.rmsprop(lr=lrn)
model.summary()

You can get the predictions by passing the test data to predict funtion 您可以通过传递测试数据来预测功能来获得预测

predictions=model.predict(X)

Link to the docs 链接到文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM