ZeroMQ Protocols - funkey/candidate_mc GitHub Wiki

Bundle Optimizer

The bundle optimizer finds a minimum of

J(x) = ½λ|x|² + P(x) + R(x)

where P(x) is a convex function and P(x) is a concave function in x.

Receives:

Initial optimization request (INITIAL_REQ):

'\x00' # first byte 0 == INITIAL_REQ
{
    "dims" : int            # number of dimensions of optimization problem
    "initial_x" : [ float ] # optional, starting point for optimization
    "parameters" : # optional
    {
        "lambda"       : float  # regularizer weight
        "steps"        : int    # number of iterations
        "min_eps"      : float  # convergence threshold, meaning depends on eps_strategy
        "eps_strategy" : str    # either "eps_from_gap" or "eps_from_change"
    }
}

Continuation optimization request (CONTINUATION_REQ):

'\x01' # first byte 1 == CONTINUATION_REQ
{
    "value"    : float     # function value at current x (from previous EVALUATE_{P,R}_RES)
    "gradient" : [ float ] # gradient at current x
}

Sends

Evaluate response (EVALUATE_P_RES) for value and gradient of convex part of objective P(x):

'\x02' # first byte 2 == EVALUATE_P_RES
{
    "x"   : [ float ] # next x to evaluate
    "eps" : float,    # current eps
}

Evaluate response (EVALUATE_R_RES) for value and gradient of concave part of objective R(x):

'\x02' # first byte 4 == EVALUATE_R_RES
{
    "x"   : [ float ] # next x to evaluate
    "eps" : float,    # current eps
}

Final response (FINAL_RES):

'\x03' # first byte 3 == FINAL_RES
{
    "x"      : [ float ], # optimal x
    "value"  : float,     # value at optimum
    "eps"    : float,     # final eps
    "status" : str        # status of solver: "reached_min_eps", "reached_max_steps", "error"
}