Reinforcement Learning, Ciencia De Dados, Data Science, Machine Learning.
actions_mapping ={ 0: move_left, 1: move_up, 2: move_right, 3: move_down } pi = {} for s in states: vals = [] for a in [0,1,2,3]: movement = actions_mapping[a] q = rewards[movement(s)] + 1*V[movement(s)] vals.append(q) pi[s] = argmax(vals) m = np.array([x for x in pi.values()]).reshape(5,-1) A