tommyod / streprogen

The Python strength program generator.
https://github.com/tommyod/streprogen/
GNU General Public License v3.0
38 stars 9 forks source link

[MRG] non-linear objective in optimization with more tests #15

Closed tommyod closed 4 years ago

tommyod commented 4 years ago

Example from Jens:

Week 3
  Day 1
   Bench              8 x 65   7 x 70   7 x 70   6 x 70   
   Squats             12 x 25  11 x 25  
   Seated rows        10 x 40  10 x 40  10 x 40  10 x 40  10 x 40  9 x 45   
   Curls              3 x 12

after

Week 3
  Day 1
   Bench              8 x 65   7 x 70   7 x 70   6 x 70   
   Squats             12 x 25  11 x 25  11 x 25  
   Seated rows        10 x 40  10 x 40  10 x 40  
   Curls              3 x 12
RPallas92 commented 4 years ago

What is the reason behind this change ?

tommyod commented 4 years ago

What is the reason behind this change ?

A case when the optimization routine return a non-nonsensical answer with way too many repetitions. The inputs in the program (not included) were kind of atypical, but the result was no good still.

Fixed by introducing dummy variables to approximate a convex error function (think y = x^2) instead of a linear error function (think y = |x|). If one is interested in details regarding this, see literature on approximating convex functions in linear programs.