tanner#
- caf.distribute.cost_functions.tanner(base_cost, alpha, beta, min_return_val=1e-150, max_return_val=1e+100)#
Apply the tanner cost function.
- Parameters:
base_cost (np.ndarray) – Array of the base costs.
alpha (float) – Parameters of the tanner cost function, see Notes.
beta (float) – Parameters of the tanner cost function, see Notes.
min_return_val (float) – The minimum value allowed in the return. Avoid return arrays with values such as 1e-300 which lead to overflow errors when divisions are made.
max_return_val (float) – The maximum value allowed in the return. Avoid return arrays with values such as np.inf which lead to errors.
- Returns:
Output from the tanner equation, same shape as base_cost.
- Return type:
tanner_costs
Notes
Formula used for this function is:
\[f(C_{ij}) = C_{ij}^\alpha \cdot \exp(\beta C_{ij})\]where:
\(C_{ij}\): cost from i to k.
\(\alpha, \beta\): calibration parameters.