sarsa_trace_update#

sarsa_trace_update(model_free_values, second_stage_values, starting_state, action, reached_second_stage, reward, learning_rate, eligibility_trace)[source]#

sarsa_trace, applied to the values in place.

Parameters:
model_free_valuesnumpy.ndarray

The first-stage model-free values, shape (states, actions). Updated in place.

second_stage_valuesnumpy.ndarray

The second-stage values, a 1D array. Updated in place.

starting_state, action, reached_second_stageint
reward, learning_rate, eligibility_tracefloat
Returns:
stage1_prediction_error, stage2_prediction_errorfloat