Cost functions with and without minimum values

Most cost functions have many local minimum values and although Embed tries to avoid local minima, the one Embed finds may not be the overall minimum. To be sure that it is the global minimum, you may want to perform several runs of the optimizer, using different initial parameterUnknown values.

It is possible that a cost function has no minimum or has a flat surface away from the minima. In this case, the global optimizer gets confused and wanders aimlessly (how can you run downhill when there is no hill?). If the optimizer appears to run for a long time with little convergence, you should suspect flat spots in your cost function. In such cases, you may have to reformulate the cost function so that it has at least one minimum. A common mistake is to put a limit block just before the cost input. In this case, the optimizer experiments with larger and larger unknown values to no avail. If a limit block is used in the cost function, it must be placed before an integration of total error.