experiment with a highly-heuristic optimizer.
there is no theory, only practice, and the practice ain't even good.
you will need the files from the library directory, and possibly dlib.