Skip to contents

This function creates a flow logger object that calculates metrics and logs them into the console. The metrics definition are done very similarly to the flow_stopper() function (see its help page), but the formulas are divided into lists, each list being printed in a different line.

Usage

flow_logger(
  formulas_list = list(list(t ~ paste("=> Iter:", .m), mean(f) ~ paste("mean(f):",
    round(.m, 4)))),
  log_each = 1,
  sep = " -- ",
  args_alert = list(),
  args_ul = list()
)

Arguments

formulas_list

A list of formulas as in flow_stopper() (a list of lists), except the RHS to be a function that takes the LHS value .m and returns a single string to be printed.

log_each

An integer specifying the frequency of logging.

sep

A character string used to concatenate logs associated with a list inside formulas_list.

args_alert, args_ul

A list of arguments passed to cli::cli_alert() and cli::cli_ul(), the functions that format the console output.

Value

A "flow_logger"-class object to be passed to optimize_phy().

Details

The LHS of the formulas are evaluated in the same way as in flow_stopper() (see its help page), but the user only access the current results (\(R_t\)). Additionally, any metric of the current iteration (\(M_t\)) can be accessed by its name (if formulas was named).