Skip to content

Commit

Permalink
Merge pull request #342 from Gurobi/main
Browse files Browse the repository at this point in the history
Backport changes to 1.5.x. to get the 2 bug fixes
  • Loading branch information
pobonomo authored Sep 4, 2024
2 parents 19473c6 + 13422a8 commit bde9114
Show file tree
Hide file tree
Showing 100 changed files with 35 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ jobs:
gurobi-machinelearning \
https://pypi.anaconda.org/gurobi-machinelearning-wheels-staging/simple/gurobi-machinelearning/
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@v1.9.0
uses: pypa/gh-action-pypi-publish@v1.10.0
with:
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/
if: ${{ github.event.inputs.pypi_repo == 'testpypi' }}
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.9.0
uses: pypa/gh-action-pypi-publish@v1.10.0
with:
password: ${{ secrets.PYPI_TOKEN }}
if: ${{ github.event.inputs.pypi_repo == 'pypi' }}
9 changes: 4 additions & 5 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
gurobipy==11.0.2
gurobipy-pandas==1.1.2
ipykernel==6.29.4
gurobipy==11.0.3
gurobipy-pandas==1.1.4
ipykernel==6.29.5
jupytext==1.16.2
matplotlib==3.6.0
matplotlib-inline==0.1.7
sphinxcontrib_bibtex==2.6.2
numpy==1.26.4
numpydoc==1.7.0
pandas==2.2.2
scikit-learn==1.5.0
scikit-learn==1.5.1
seaborn==0.13.2
Sphinx==7.3.7
sphinx-copybutton==0.5.2
sphinx-rtd-theme==2.0.0
nbsphinx==0.9.4
jupytext==1.16.2
sphinx_design==0.6.0
sphinx-pyproject==0.3.0
Expand Down
2 changes: 1 addition & 1 deletion requirements.lightgbm.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lightgbm==4.3.0
lightgbm==4.5.0
2 changes: 1 addition & 1 deletion requirements.pandas.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pandas==2.2.2
gurobipy-pandas==1.1.2
gurobipy-pandas==1.1.4
2 changes: 1 addition & 1 deletion requirements.pytorch.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
torch==2.2.2
torch==2.4.0
2 changes: 1 addition & 1 deletion requirements.sklearn.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
scikit-learn==1.5.0
scikit-learn==1.5.1
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
gurobipy==11.0.2
gurobipy==11.0.3
numpy==1.26.4
pandas==2.2.2
scikit-learn==1.5.0
scikit-learn==1.5.1
seaborn==0.13.2
.
2 changes: 1 addition & 1 deletion requirements.xgboost.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
xgboost==2.0.3
xgboost==2.1.1
6 changes: 6 additions & 0 deletions src/gurobi_ml/torch/sequential.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,17 @@ def _mip_model(self, **kwargs):
)
_input = layer.output
elif isinstance(step, nn.Linear):
layer_weight = None
layer_bias = None
for name, param in step.named_parameters():
if name == "weight":
layer_weight = param.detach().numpy().T
elif name == "bias":
layer_bias = param.detach().numpy()
if layer_weight is None:
raise NotImplementedError("No weights specified for newwork layer.")
if layer_bias is None:
layer_bias = 0.0
layer = self._add_dense_layer(
_input,
layer_weight,
Expand Down
Binary file modified tests/predictors/circle__decisiontreeregressor.joblib
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/predictors/circle__randomforestregressor.joblib
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/predictors/circle_sklearn_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.0
1.5.1
Binary file modified tests/predictors/diabetes__decisiontreeregressor.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes__gradientboostingregressor.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes__lasso.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes__linearregression.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes__mlpregressor_20x20.joblib
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/predictors/diabetes__pipeline_standardscaler_lasso.joblib
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/predictors/diabetes__pipeline_standardscaler_ridge.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes__plscanonical.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes__plsregression.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes__pytorch.pt
Binary file not shown.
Binary file modified tests/predictors/diabetes__randomforestregressor.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes__ridge.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes_pandas__decisiontreeregressor.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes_pandas__gradientboostingregressor.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes_pandas__lasso.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes_pandas__linearregression.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes_pandas__mlpregressor_20x20.joblib
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified tests/predictors/diabetes_pandas__plscanonical.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes_pandas__plsregression.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes_pandas__randomforestregressor.joblib
Binary file not shown.
Binary file modified tests/predictors/diabetes_pandas__ridge.joblib
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/predictors/diabetes_pandas_sklearn_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.0
1.5.1
2 changes: 1 addition & 1 deletion tests/predictors/diabetes_sklearn_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.0
1.5.1
Binary file modified tests/predictors/iris__logisticregression.joblib
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/predictors/iris_sklearn_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.0
1.5.1
Binary file modified tests/predictors/mnist__mlpclassifier.joblib
Binary file not shown.
Binary file modified tests/predictors/mnist__pipeline_mlpclassifier.joblib
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/predictors/mnist_sklearn_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.0
1.5.1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/predictors/wages_sklearn_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.0
1.5.1
10 changes: 10 additions & 0 deletions toxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import shutil

from tox.plugin import impl
from tox.tox_env.api import ToxEnv


@impl
def tox_env_teardown(tox_env: ToxEnv):
print(f"removing env dir: {tox_env}")
shutil.rmtree(tox_env.env_dir)

0 comments on commit bde9114

Please sign in to comment.