Passive-aggressive optimization. Mainly based on:
Zakov, Shay and Goldberg, Yoav and Elhaded, Michael and Ziv-Ukelson, Michal Rich Parameterization Improves RNA Structure Prediction RECOMB 2011
and
Crammer, Koby and (et al) Online Passive-Aggressive Algorithms Journal of Machine Learning Research (2006)
TODO as always: move out of here and put in its own library
Documentation
defaultPA :: Double -> Params -> TrainingData -> PASource
Default implementation of P/A. We return a data structure that contains
all changes
required from this run, the enerDif
or energy difference
between the known and the predicted structure, and a structural difference
score. Furthermore, some errors are being reported in errors
.
The energy difference can be (i) in that case, a wrongly predicted structure has better (lower) energy than the known one. (ii) It can be zero, then we have either found a co-optimal structural or the correct structure. (iii) In some cases, it can be positive, this is a formal error, but will not abort the program. (The calling program may opt to abort on (not . null $ errors).
The structural difference is [0..1] with 0 for structurally identical predictions and known structures and otherwise growing toward 1 for bad predictions where nothing is correct.
In case that the known structure has a score epsilon
better than the
predicted, we have an error condition, as this should never be the case.
Return a lot of information from each P/A call. We do not return the new
Params
anymore, only a list of changes. This allows us to do some things.
If the implementation of Params
is switched, we can update in place; or we
can perform calculations in parallel.