cog-imperial / OMLT

Represent trained machine learning models as Pyomo optimization formulations
Other
257 stars 56 forks source link

Support for explicit padding and dilations in 2D CNN layers #138

Open jezsadler opened 7 months ago

jezsadler commented 7 months ago

To address issue More features for CNN in OMLT #129, including padding and dilations for 2D layers in CNNs. I've made changes to the Layer2D class and its subclasses PoolingLayer2D and ConvLayer2D, as well as the network parsing functions that will build them.

This is passing tests that demonstrate it hasn't broken anything for layers without padding or dilations, but I haven't had a good example to validate that it's producing the correct results for layers with these attributes.

Not implemented:

Legal Acknowledgement\ By contributing to this software project, I agree my contributions are submitted under the BSD license. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (a3d128d) 91.67% compared to head (97ba41b) 92.35%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #138 +/- ## ========================================== + Coverage 91.67% 92.35% +0.67% ========================================== Files 29 29 Lines 1730 1752 +22 Branches 327 330 +3 ========================================== + Hits 1586 1618 +32 + Misses 74 70 -4 + Partials 70 64 -6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.