add_sequential_constr¶
- gurobi_ml.torch.sequential.add_sequential_constr(gp_model, sequential_model, input_vars, output_vars=None, **kwargs)¶
Formulate sequential_model into gp_model.
The formulation predicts the values of output_vars using input_vars according to sequential_model. See our Users Guide for details on the mip formulation used.
- Parameters:
gp_model (gurobipy model) – The gurobipy model where the sequential model should be inserted.
sequential_model – The sequential model to insert as predictor.
input_vars (mvar_array_like) – Decision variables used as input for model represented by pytorch object.
output_vars (mvar_array_like, optional) – Decision variables used as output for model represented by pytorch object.
- Returns:
Object containing information about what was added to model to insert the predictor in it
- Return type:
- Raises:
NoModel – If the translation for some of the Pytorch model structure (layer or activation) is not implemented.
Warning
Only layers and layers are supported.
Notes
See
add_predictor_constr
for acceptable values for input_vars and output_vars