def linear_annealing(n, total, p_initial, p_final):
    'Linearly interpolates a probability between p_initial and p_final.\n\n  Current probability is based on the current step, n. Used to linearly anneal\n  the exploration probability of the RLTuner.\n\n  Args:\n    n: The current step.\n    total: The total number of steps that will be taken (usually the length of\n      the exploration period).\n    p_initial: The initial probability.\n    p_final: The final probability.\n\n  Returns:\n    The current probability (between p_initial and p_final).\n  '
    if (n >= total):
        return p_final
    else:
        return (p_initial - ((n * (p_initial - p_final)) / total))
Linearly interpolates a probability between p_initial and p_final.

Current probability is based on the current step, n. Used to linearly anneal
the exploration probability of the RLTuner.

Args:
  n: The current step.
  total: The total number of steps that will be taken (usually the length of
    the exploration period).
  p_initial: The initial probability.
  p_final: The final probability.

Returns:
  The current probability (between p_initial and p_final).
def linear_annealing(n, total, p_initial, p_final):
    'Linearly interpolates a probability between p_initial and p_final.\n\n  Current probability is based on the current step, n. Used to linearly anneal\n  the exploration probability of the RLTuner.\n\n  Args:\n    n: The current step.\n    total: The total number of steps that will be taken (usually the length of\n      the exploration period).\n    p_initial: The initial probability.\n    p_final: The final probability.\n\n  Returns:\n    The current probability (between p_initial and p_final).\n  '
    if (n >= total):
        return p_final
    else:
        return (p_initial - ((n * (p_initial - p_final)) / total))