Skip to content

Commit

Permalink
merge validation to main
Browse files Browse the repository at this point in the history
  • Loading branch information
b4pm-devops committed Oct 29, 2024
2 parents eb9ba2d + b92b37f commit 299a215
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -657,14 +657,13 @@ def compute_sos_jacobian(self):
raise Exception(
'Gradients for constraints which are not dataframes or arrays are not yet implemented')

dict_grad_ineq = {}
dict_grad_eq = {}
grad_val_ineq = {}
grad_val_eq = {}
# g'(h(x)) * h'(x)
if len(value_gh_l) != 0:
if self.func_manager.aggr_mod_ineq == 'smooth_max' and len(value_gh_l) != 0:
grad_val_ineq = get_dsmooth_dvariable(value_gh_l)
if len(value_ghk_l) != 0:
if self.func_manager.aggr_mod_ineq == 'smooth_max' and len(value_ghk_l) != 0:
grad_val_eq = get_dsmooth_dvariable(value_ghk_l)
i = 0
j = 0
Expand All @@ -674,7 +673,6 @@ def compute_sos_jacobian(self):
if var_f_type == self.INEQ_CONSTRAINT:

input_var_value = inputs_dict[variable_name]
dict_grad_ineq[variable_name] = grad_val_ineq[i]
if isinstance(input_var_value, np.ndarray):

if self.func_manager.aggr_mod_ineq == 'smooth_max':
Expand Down Expand Up @@ -714,7 +712,6 @@ def compute_sos_jacobian(self):

elif var_f_type == self.EQ_CONSTRAINT:
input_var_value = inputs_dict[variable_name]
dict_grad_eq[variable_name] = grad_val_eq[j]
if isinstance(input_var_value, np.ndarray):
if self.func_manager.aggr_mod_eq == 'smooth_max':
grad_lagr_val = np.array(grad_value_l[variable_name]) * grad_val_eq[j]
Expand Down

0 comments on commit 299a215

Please sign in to comment.