Comments (6)
Thinking a bit more about this, there is a documentation effort to make. In most cases those intermediate variables are stored but that part is not documented. This should definitely be done at some point. But it is tedious to go through all objects (and also make sure that names are somewhat consistent).
I'll try to start with neural networks but I won't promise a delivery date.
from gurobi-machinelearning.
This is not trivial to do but it can be done by inspecting the modeling object that is created when the neural network is added to the gurobipy model (the object returned by add_predictor_constr).
This object should contain the layers of the network and for each layer it's input and output.
It would take me a bit of time but I could make an example.
from gurobi-machinelearning.
Many thanks for the help and happy to get an example.
to update afterward the bounds after the add_predictor_constr, would you advise to use "setAttr("lb"/"ub",value)", add additional constraint or is there a better way ?
from gurobi-machinelearning.
Doing a very simple example is not so long.
What I did doesn't really make sense but I hope it shows how I would do it.
it's a variation of the adversarial example from the documentation were after solving the model I put bounds on the output of the first layer (you can search for "Add bounds")
to update afterward the bounds after the add_predictor_constr, would you advise to use "setAttr("lb"/"ub",value)", add additional constraint or is there a better way ?
Yes I would change directly the bounds of the variables as I did in the notebook.
from gurobi-machinelearning.
Excellent.
if you're interested i might fork and give a try to add some function that compute valid bounds and update the gurobi model (using interval arithmetic or this kind of method https://github.com/eth-sri/eran) ? or maybe you're interested to look at it yourself too :)
from gurobi-machinelearning.
Yes that would be nice. I am not sure how much I can do in this direction but it would definitely be interesting.
from gurobi-machinelearning.
Related Issues (20)
- Tests should generate the predictor they need if the file is not there HOT 1
- Support pandas input, handle better fixed features
- Explain better the source of infeasibilites w.r.t. predictor in decision tree models
- Speed up model generation for decision trees HOT 1
- Make model generation faster for nested formulations
- [feature request] support paddle HOT 1
- Type of variables for classication
- BUG: local variable 'trans_constr' referenced before assignment HOT 1
- Missing tests for column transformer
- Add support for XGBoost regressors HOT 2
- Issues in fixed formulation test when it fails
- Support xgboost sklearn API in sklearn pipelines
- [feature request] Support sklearn monotonic constraints HOT 1
- XGBoost constraints don't work with verbose mode HOT 2
- Accept list of lists of variables as argument to add_pred_constr
- Support for LightGBM HOT 1
- Bug with a column transformer and empty list of columns
- Remove dependency on scikit-learn
- Support for PLSRegression from scikit-learn HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gurobi-machinelearning.