Skip to content

Commit

Permalink
Update register_special.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitriAlston committed Nov 22, 2024
1 parent 08ea66c commit 96fb9b1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/eago_optimizer/functions/nonlinear/register_special.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ for operator in (:relu, :leaky_relu, :maxsig, :maxtanh, :softplus, :pentanh, :si
:softsign, :gelu, :swish, :xabsx, :logcosh, :xlogx, :erf, :erfinv, :erfc)
func = quote
model = owner_model(x)
op = get(model.obj_dict, Symbol("EAGO_", $operator), nothing)
op = get(model.obj_dict, Symbol("EAGO_", $(String(operator))), nothing)
if op === nothing
op = add_nonlinear_operator(
model,
1,
getfield(McCormick, Symbol($operator)),
getfield(McCormick, Symbol($operator, "_deriv")),
getfield(McCormick, Symbol($operator, "_deriv2"));
name = Symbol("EAGO_", $operator),
getfield(McCormick, Symbol($(String(operator)))),
getfield(McCormick, Symbol($(String(operator)), "_deriv")),
getfield(McCormick, Symbol($(String(operator)), "_deriv2"));
name = Symbol("EAGO_", $(String(operator))),
)
model[Symbol("EAGO_", $operator)] = op
model[Symbol("EAGO_", $(String(operator)))] = op
end
return op(x)
end
Expand Down

0 comments on commit 96fb9b1

Please sign in to comment.