Gurobi / gurobi-machinelearning

Formulate trained predictors in Gurobi models
https://gurobi-machinelearning.readthedocs.io/
Apache License 2.0
215 stars 44 forks source link

[#315] Respect missing bias #325

Closed bzfwunde closed 2 months ago

bzfwunde commented 4 months ago

If in a pytorch layer no bias is provided, we errornously used the bias from the previous layer. We must use 0 bias instead. Added extend pytorch example thanks to Pierre.

This addresses #315. @fuadcan, could you please test that it fixes your issue? Thanks!

CLAassistant commented 4 months ago

CLA assistant check
All committers have signed the CLA.

pobonomo commented 4 months ago

I'll probably have forgotten by next time we need to do it but here is how I generated the new test network for pytorch (adding one layer without bias): https://gist.github.com/pobonomo/8d429bdc381690328868e684867ff972