Skip to content

Training and testing

RLTrainer and RLTester are what rlr train and rlr test call. Both take the resolved configuration dict and are usable directly from Python.

RLTrainer

__init__(cfg)

train()

RLTester

__init__(cfg)

run_cfg_test(reload_model=True)

run_episode(seed=None, num_steps=100, init_env=True, load_model=True)

eval_episode(episode, test_result)

print_res_all_ep(test_result=None)

get_fig(signals_layout, ep_idx=0, test_result=-1)

Results

Both classes accumulate results in two layers:

Layer Contents
res per-episode arrays: lengths, returns, per-step formula values
res_all_ep aggregates: basics (mean_ep_len, mean_ep_rew, completed), reward_formulas, eval_formulas

rlr plot and rlr select-model read the same data from the res_step_*.yml files that training writes at every evaluation.