且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Keras LSTM和致密层

更新时间:2023-12-03 11:04:40

否,Dense层不能那样工作,输入具有50维,输出将具有等于神经元数量的尺寸,一个在这种情况下.输出是输入加上偏差的加权线性组合.

No, Dense layers do not work like that, the input has 50-dimensions, and the output will have dimensions equal to the number of neurons, one in this case. The output is a weighted linear combination of the input plus a bias.

请注意,使用softmax激活时,将其与一个神经元层一起使用是没有意义的,因为softmax已标准化,所以唯一可能的输出将是常数1.0.现在可能就是您想要的.

Note that with the softmax activation, it makes no sense to use it with a one neuron layer, as the softmax is normalized, the only possible output will be constant 1.0. That's probably now what you want.