how to get the outputs from the embedding layer

跟風遠走 提交于 2019-12-05 19:39:44

You can get the output of any layer, not just an embedding layer, as described here:

from keras import backend as K
get_3rd_layer_output = K.function([model.layers[0].input],
                                  [model.layers[3].output])
layer_output = get_3rd_layer_output([X])[0]

In your case, you would want model.layers[0].output instead of model.layers[3].output.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!