  This paper presents a neural network optimizer with soft-argmax operator to
achieve an ecological gearshift strategy in real-time. The strategy is
reformulated as the mixed-integer model predictive control (MIMPC) problem to
minimize energy consumption. Then the outer convexification is introduced to
transform integer variables into relaxed binary controls. To approximate binary
solutions properly within training, the soft-argmax operator is applied to the
neural network with the fact that all the operations of this scheme are
differentiable. Moreover, this operator can help push the relaxed binary
variables close to 0 or 1. To evaluate the strategy effect, we deployed it to a
2-speed electric vehicle (EV). In contrast to the mature solver Bonmin, our
proposed method not only achieves similar energy-saving effects but also
significantly reduces the solution time to meet real-time requirements. This
results in a notable energy savings of 6.02% compared to the rule-based method.
