Skip to content

Error in PoolingLayer constructor #11

@Aerocool

Description

@Aerocool

Dear developer team,

I think your PoolingLayer constructor is having a bug in line 90.

public PoolingLayer(FeatureMapsLayer fromLayer, Dimension2D kernelDim, int numberOfMaps, NeuronProperties neuronProp) {
        this.kernel = this.kernel;

Instead it should be

this.kernel = new Kernel(kernelDim);

like in the constructor above.
I also suggest that one constructor calls the other one giving the default parameters for better maintenance. Something like:

public PoolingLayer(FeatureMapsLayer fromLayer, Dimension2D kernelDim) {
       int numberOfMaps = fromLayer.getNumberOfMaps();
       this (fromLayer, kernelDim, numberOfMaps, DEFAULT_NEURON_PROP);
    }

    public PoolingLayer(FeatureMapsLayer fromLayer, Dimension2D kernelDim, int numberOfMaps, NeuronProperties neuronProp) {
        this.kernel = new Kernel(kernelDim);
        Dimension2D fromDimension = fromLayer.getMapDimensions();
        int mapWidth = fromDimension.getWidth() / this.kernel.getWidth();
        int mapHeight = fromDimension.getHeight() / this.kernel.getHeight();
        this.mapDimensions = new Dimension2D(mapWidth, mapHeight);
        this.createFeatureMaps(numberOfMaps, this.mapDimensions, kernelDim, neuronProp);
    }

Best regards
Thilo Nietzschmann

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions