def max_pooling(matrix, pool_size):
"""
Applies max-pooling for the given matrix for specified pool_size.
Only the maximum value in the given pool size is chosen to construct the result.
:param matrix: Input matrix
:param pool_size: pooling cell size
:return: max-pooled output
"""
"""
t_input = tensor.dmatrix('input')
pool_out = ds.max_pool_2d(t_input, pool_size, ignore_border=True)
pool_f = theano.function([t_input], pool_out)
return pool_f(matrix)
"""
pass
评论列表
文章目录