  Identifying optimal thermodynamical processes has been the essence of
thermodynamics since its inception. Here, we show that differentiable
programming (DP), a machine learning (ML) tool, can be employed to optimize
finite-time thermodynamical processes in a quantum thermal machine. We consider
the paradigmatic quantum Otto engine with a time-dependent harmonic oscillator
as its working fluid, and build upon shortcut-to-adiabaticity (STA) protocols.
We formulate the STA driving protocol as a constrained optimization task and
apply DP to find optimal driving profiles for an appropriate figure of merit.
Our ML scheme discovers profiles for the compression and expansion strokes that
are superior to previously-suggested protocols. Moreover, using our ML
algorithm we show that a previously-employed, intuitive energetic cost of the
STA driving suffers from a fundamental flaw, which we resolve with an
alternative construction for the cost function. Our method and results
demonstrate that ML is beneficial both for solving hard-constrained quantum
control problems and for devising and assessing their theoretical groundwork.
