RNN输出和基于规则的输出有什么不同?

问题描述 投票:0回答:1

我是机器学习的新手,我有一个问题,我是following this tutorial,我读到LSTM和RNN。我使用教程提供的代码并运行它,它完成了培训,现在我给了一些测试字符串:

Training data is this :

输出是:

Iter= 20000, Average Loss= 0.531466, Average Accuracy= 84.60%
['the', 'sly', 'and'] - [treacherous] vs [treacherous]
Optimization Finished!
Elapsed time:  12.159853319327036 min
Run on command line.
    tensorboard --logdir=/tmp/tensorflow/rnn_words
Point your web browser to: http://localhost:6006/
3 words: ,hello wow and
Word not in dictionary
3 words: mouse,mouse,mouse
3 words: mouse
3 words: mouse mouse mouse
mouse mouse mouse very well , but who is to bell the cat approaches the until will at one another and take mouse a receive some signal of her approach , we he easily escape
3 words: 3 words: had a general
had a general to proposal to make round the neck will all agree , said he easily at and enemy approaches to consider what common the case . you will all agree , said he
3 words: mouse mouse mouse
mouse mouse mouse very well , but who is to bell the cat approaches the until will at one another and take mouse a receive some signal of her approach , we he easily escape
3 words: what was cat
what was cat up and said he is all very well , but who is to bell the cat approaches the until will at one another and take mouse a receive some signal of her
3 words: mouse fear cat
Word not in dictionary
3 words: mouse tell cat
Word not in dictionary
mo3 words: mouse said cat
Word not in dictionary
3 words: mouse fear fear
Word not in dictionary
3 words: mouse ring bell
Word not in dictionary
m3 words: mouse ring ring
Word not in dictionary
3 words: mouse bell bell
mouse bell bell and general to make round the neck will all agree , said he easily at and enemy approaches to consider what common the case . you will all agree , said he
3 words: mouse and bell
mouse and bell this means we should always , but looked is young always , but looked is young always , but looked is young always , but looked is young always , but looked
3 words: mouse was bell
mouse was bell and said he is all very well , but who is to bell the cat approaches the until will at one another and take mouse a receive some signal of her approach
3 words: 

现在我没有得到什么,当我给出三个单词时,它会给出一些我们可以通过正则表达式或基于规则的代码轻松实现的结果,使用if-else就像输入文件中的输入单词然后获取一些句子上一句或下一句,什么是特别关于这个输出,它有何不同?请解释

就像有时它说的那样,单词不在dict中,所以如果我只需要提供训练文件中的那些单词那么就像它在训练数据中匹配的单词并从文件中获取一些结果那么我们就可以用if else或者在没有任何模块的纯编程中,它的不同之处是什么?

machine-learning tensorflow deep-learning artificial-intelligence lstm
1个回答
0
投票

您的训练数据集只有大约180个单词,并且达到了84.6%(训练)的准确度,因此它过度拟合了很多。本质上,该模型只是根据训练数据预测下一个最可能的单词。

通常,语言模型在更大的数据集上进行训练,例如PTB或1B字基准。 PTB是一个小数据集,有100,000个单词,1B单词基准有10亿个单词。

RNN模型具有有限的词汇表以允许对单词或字符进行编码。词汇量大小取决于模型。在PTB上训练的大多数单词模型的词汇量大小为10,000,这对于大多数常见单词来说已经足够了。

© www.soinside.com 2019 - 2024. All rights reserved.