# Performing max-min optimization with optimization.jl

**URL:** <https://discourse.julialang.org/t/performing-max-min-optimization-with-optimization-jl/121991>\
**Category:** Optimization (Mathematical)\
**Tags:** optimization, neural-network, lux\
**Created:** [October 30, 2024, 12:36pm UTC](https://discourse.julialang.org/t/performing-max-min-optimization-with-optimization-jl/121991 "2024-10-30T12:36:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KianH](https://avatars.discourse-cdn.com/v4/letter/k/c6cbf5/32.png) [@KianH](https://discourse.julialang.org/u/KianH)\
**Post date:** [October 30, 2024, 12:36pm UTC](https://discourse.julialang.org/t/performing-max-min-optimization-with-optimization-jl/121991/1 "2024-10-30T12:36:01Z")

</div>

Hello,

I was wondering if it is possible to solve minimax optimization problems using `Optimization.jl` for neural networks? I am currently performing the optimization using `Optimization.solve(...)`. I am specifically interested in multiplying the gradients of the loss function with respect to _some_ parameters, by -1 so that the loss function is maximized with respect to those specific parameters and minimized with respect to the rest of the parameters. I would assume that this would have to be done in the callback function since I am using `solve(...)`? Just for clarification, my code is very long and I would prefer to keep it in the current format with `Optimization.solve(...)`.
