magnet icon indicating copy to clipboard operation
magnet copied to clipboard

Slightly confusing part in Conv _set_padding()

Open greed2411 opened this issue 6 years ago • 1 comments

I was just going through source code and found this snippet in core.py:

        if p == 'half': f = 0.5
        elif p == 'same': f = 1
        elif p == 'double':
            self._upsample = 2
            if self._args['c'] is None:
                self._args['c'] = in_shape[1] // 2
            f = 1
        else: return

s = 1 / f

where f doesn't seem to be a meaningful way of addressing the padding method.

Better naming conventions could be possible, I guess.

greed2411 avatar Sep 05 '18 11:09 greed2411

I agree.

I think this could be refactored from scratch.

Beginners will not find it difficult.

I found this tutorial to be a good resource when writing this. Helps with the mathematics of shape.

svaisakh avatar Sep 05 '18 11:09 svaisakh