hls4ml icon indicating copy to clipboard operation
hls4ml copied to clipboard

For encoded convolution, add check for when min_width would have been larger than in_width

Open jmitrevs opened this issue 2 years ago • 2 comments

Description

In the encoded convolution, the case when the in_width is smaller than the nominal min_width needs to be handled as a special case. This attempts to fix this situation. It has been been minimally tested in a conv1d case where in_width = 11 while the kernel width is 9. Additional tests need to be made.

Type of change

For a new feature or function, please create an issue first to discuss it with us before submitting a pull request.

Note: Please delete options that are not relevant.

  • [x] Bug fix (non-breaking change that fixes an issue)

Tests

test_conv1d_narrow.py fails in main, but passes after this fix.

Checklist

  • [x] I have read the guidelines for contributing.
  • [x] I have commented my code, particularly in hard-to-understand areas.
  • [x] My changes generate no new warnings.
  • [x] I have added tests that prove my fix is effective or that my feature works.

jmitrevs avatar Jul 18 '22 04:07 jmitrevs

This has been tested for 1D, and could be merged in the more restricted sense, but it has not been tested for 2D. I think planning should take into account the future of encoded.

jmitrevs avatar Sep 15 '22 22:09 jmitrevs

I will restrict this PR to the 1D case because I think that's the only one that would be important. If we fix it for 2D, we can make a different PR.

jmitrevs avatar Oct 13 '22 21:10 jmitrevs

There are some issues still, so I am converting to a draft till I get a chance to look.

jmitrevs avatar Oct 28 '22 22:10 jmitrevs

This should now also fix the same issue with Conv2D.

jmitrevs avatar Jan 11 '23 17:01 jmitrevs

@vloncar, are you happy with the changes here as they are?

jmitrevs avatar Jan 12 '23 20:01 jmitrevs

Is there anything left to do here before it's merged?

jmitrevs avatar Feb 13 '23 17:02 jmitrevs