magnet
magnet copied to clipboard
Slightly confusing part in Conv _set_padding()
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.
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.