Learn R Programming

vectools (version 0.2.0)

71_pooling: Pooling

Description

Pooling functions for matrices.

POOLING AND CONVOLUTION FUNCTIONS ARE ONLY EARLY PROTOTYPES. THEY HAVE HAD LIMITED TESTING AND MAY BE CHANGED IN FUTURE UPDATES.

Usage

vt2.pool.matrix (x, nsub, …, f=mean, edge.method="exact")
vt2.pool2.matrix (x, ntar, …, f=mean)

Arguments

x

A matrix.

nsub

An integer of length two, giving the size of the submatrices.

ntar

An integer vector of length two. The preferred return matrix size. (Currently, this is not exact, but should be in the future).

f

A function of a matrix. This matrix will be a submatrix of the matrix x.

edge.method

String, either "exact" or "spart". Refer to details.

Ignored.

Value

A matrix.

Details

These functions partition a matrix into a set of smaller matrices. (The submatrices do not overlap).

In the pool function the user specifies the submatrix size, and in the pool2 function the user specifies the (approx) target size.

In the "exact" edge method, the input matrix needs to divisible into equally sized matrices. An error is produced if this is not possible.

In the "spart" edge method, smaller equal or near-equal sized matrices are used for edge cases.

See Also

Convolutions

Image Filters

Examples

Run this code
# NOT RUN {
x <- matrix (1:40, 4, 10)
vt2.pool.matrix (x, c (2, 2) )
# }

Run the code above in your browser using DataLab