NELSONZHAO / zhihu

This repo contains the source code in my personal column (https://zhuanlan.zhihu.com/zhaoyeyu), implemented using Python 3.6. Including Natural Language Processing and Computer Vision projects, such as text generation, machine translation, deep convolution GAN and other actual combat code.
https://zhuanlan.zhihu.com/zhaoyeyu
3.5k stars 2.14k forks source link

有關預測和訓練時 輸入句數(batch size)不同的問題 #8

Open billy800413 opened 6 years ago

billy800413 commented 6 years ago

請問一下有辦法能讓預測時真的只要輸入一個句子就好嗎? 就是這段程式碼不用batch_size answer_logits = sess.run(logits, {input_data: [text]batch_size, target_sequence_length: [len(input_word)]batch_size, source_sequence_length: [len(input_word)]batch_size})[0]

parahaoer commented 6 years ago

我也有同样的困惑,为什么要乘以batch_size呢?请问你知道怎么改了吗