关于keras示例pretrained_word_embeddings的问题 [英] Questions about keras example pretrained_word_embeddings

查看:75
本文介绍了关于keras示例pretrained_word_embeddings的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Keras示例 pretrained_word_embeddings 有疑问加深对它如何工作的了解.

I have several questions about Keras example pretrained_word_embeddings to increase a level of understanding how it works.

  1. 在这种模型中使用dropout层是否合理?

最后的MaxPooling1D层每次都必须覆盖所有输出形状吗?在原始模型中,最后一个转换层的输出为35,我们将maxpool设置为相同的35值.

Last MaxPooling1D layer has to cover all output shape every time? At original model, last conv layer output is 35 and we set up maxpool the same 35 value.

我是否可以说增加值128(内核数)会提高准确性?

Am I right if to say that increase of value 128 (kernels number) will increase accuracy?

放置额外的conv层以提高准确性是否有意义?即使会减少模型训练阶段.

Is it make sense to put additional conv layers to increase the accuracy? Even if it will decrease model training phase.

谢谢!

推荐答案

因此,基本上,您的问题有一个简单的答案-您需要对其进行测试:

So basically there is one simple answer to your questions - you need to test it:

  1. 添加dropout通常是一件好事.它介绍了合理数量的随机化和正则化.缺点是您需要设置其参数的正确值-有时可能需要一段时间.
  2. 我认为-以这种方式设置了最后一个合并层中MaxPooling1D的值,以减小下一层输入的维数.一个人可以检查是否像上一层数字一半的值(在当前情况下,例如18)(仅会使下一层的输入大小受阻)可能会带来任何改善.
  3. 很难说-如果您具有少量真正刚性结构的数据-过多的参数可能会严重损害您的训练.最好的方法是在 grid random 搜索范例中测试不同的参数值.令人感到惊奇的是,随机搜索做得更好:)
  1. Adding dropout is usually a good thing. It introduces the reasonable amount of randomization and regularization. The downside is that you need to set the right value of its parameter - which sometimes might take a while.
  2. In my opinion - the value of a MaxPooling1D in the last pooling layer was set in this way in order to reduce the dimensionality of the next layer input. One may check if e.g. values like a half of the number in previous layer (in a presented case - e.g. 18) - which only doulbes the size of the input to a next layer - could introduce any improvement.
  3. It's hard to say - if you e.g. have a small amount of data with a really rigid structure - to much parameters might seriously harm your training. The best way is to test different parameters values in either grid or random search paradigm. It's belived that random search does a better job :)

这篇关于关于keras示例pretrained_word_embeddings的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆