I am very new to using gurobi and have the following issue.
I would like to add log(1+exp((-1)^y_i * (sum over k=1 for K (beta_k * a _ik)) to my objective function.
To be precise, I would like to minimize over beta while summing over i in range(n)(log(1+exp((-1)^y_i * (sum over k=1 for K (beta_k * a _ik)) - y-i (sum over k in K) beta_k*a_ik)
y is a [n,1] vector
a is a [n,k] matrix where i in range(n)
b is a vector representing coefficients with [n,k] for k in range(K)
I know, that log and exp do not exist in gurobi per se but can be achieved by auxiliary variables. The following approach has not been successful:
#z = exp(w)
w = (quicksum ([beta[k]*a[i,k]for k in range(K)]) for i in range(n))
gz = m.addGenConstrExp(beta, w)
I appreciate your help! Thank you.
Please sign in to leave a comment.