fineprint-global/fabio

optim

nk027 opened this issue · 3 comments

nk027 commented

At the moment optim is run with a lower bound of 0 and that's it. Later on (~ line 650) the result are capped with the actual production anways.

I change this - optim now runs with an upper bound of the actual production. This should work better, but may fail.

nk027 commented

Ok actually the optimised values are ultimately capped out at total production / processing for outputs / inputs. It seems only the split is done by optim?

nk027 commented

Okay I'm skipping the capping out - this defeats the purpose of optim(), if it's necessary we should adapt the loss function.

nk027 commented

Ok so:

  • Capping is hard. We could work out some maxima, but since they can then be used up in multiple ways they would be incredibly soft restrictions.
  • Adapting the loss function works quite nicely. In general we want to match the actual production values as close as possible (so we use a squared error loss) and get reasonable processing values, without overshooting (so we use squared error loss for overshoots and absolute losses for too little processing).
  • With the adapted loss function we can skip downscaling in- and out-flows (which defeated the prupose of the optimization anyways).