Keras中MaxPool和MaxPooling层有什么区别? [英] What is the difference between MaxPool and MaxPooling layers in Keras?

查看:1222
本文介绍了Keras中MaxPool和MaxPooling层有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始与Keras一起工作,并注意到有两层的最大池名称非常相似:MaxPoolMaxPooling.令我惊讶的是,我在Google上找不到两者之间的区别.所以我想知道两者之间有什么区别.

I just started working with Keras and noticed that there are two layers with very similar names for max pooling: MaxPool and MaxPooling. I was surprised that I couldn't find the difference between these two on Google; so I am wondering what the difference is between the two if any.

推荐答案

它们是相同的.您可以自己测试

they are the same. you can test it by your own

import numpy as np
import tensorflow as tf
from tensorflow.keras.layers import *

# create dummy data
X = np.random.uniform(0,1, (32,5,3)).astype(np.float32)

pool1 = MaxPool1D()(X)
pool2 = MaxPooling1D()(X)

tf.reduce_all(pool1 == pool2) # True

我使用了1D最大池化,但是对于所有池化操作(2D,3D,平均,全局池化)都有效

I used 1D max-pooling but the same is valid for all the pooling operation (2D, 3D, avg, global pooling)

这篇关于Keras中MaxPool和MaxPooling层有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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