Skip to content

Modifying maxpooling.hpp to access poolingIndices #2439

@iamshnoo

Description

@iamshnoo

The maxpooling layer has a private member called poolingIndices of the type std::vector<arma::cube>. Currently, the forward function returns only the maxpooled values.

I am writing an Unpooling layer, which needs as input, the output of the maxpool layer and also the corresponding poolingIndices. Currently, there is no way to access the indices outside the max pool layer.

My primary idea was to simply write an accessor method for the poolingIndices and then pass it in as a parameter in the constructor of the forward function. The only problem is that doesn't look too good. std::vector<arma::cube> poolingIndices seems like a pretty complicated data type for the average user to handle. So, using this data type as a return type in the accessor from maxpool and then passing this data type as a constructor parameter for unpooling is probably the least desirable way of doing this.

I am looking for alternative ways of modifying the maxpooling layer so that I can access its' private member poolingIndices more smoothly outside of it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions