How to implement a Mean Pooling layer in Keras

后端 未结 1 663
感情败类
感情败类 2021-01-06 04:08

There seems no built-in support for Mean Pooling layer for RNN in Keras. Anyone knows how to wrap one?

http://deeplearning.net/tutorial/lstm.html

相关标签:
1条回答
  • 2021-01-06 04:35

    Keras has a layer AveragePooling1D for that. If you use the graph API, you should be able to do something like:

    model.add_node(AveragePooling1D(...), 
                   inputs=['h0', 'h1', ..., 'hn'], 
                   merge_mode='concat', ...)
    
    0 讨论(0)
提交回复
热议问题