Closed oeccsy closed 3 months ago
python script secretary_problem_case_monte_carlo_control.py 에 아래 코드와 같이 print() 코드 추가
secretary_problem_case_monte_carlo_control.py
def update_agent(history): cum_reward = 0 for transition in history[::-1]: order, ranking, a, r = transition # 몬테카를로 방식으로 업데이트 Q[order-1, ranking-1, a] = Q[order-1, ranking-1, a] + alpha * (cum_reward - Q[order-1, ranking-1, a]) cum_reward = cum_reward + r print(f'update : [{order-1},{ranking-1}] 에서 {a}한 결과 {r}') print(f'Q[{order-1},{ranking-1},{a}]값이 {Q[order-1, ranking-1, a]}로 업데이트 됨')
# 몬테카를로 방식으로 업데이트 cum_reward = cum_reward + r Q[order-1, ranking-1, a] = Q[order-1, ranking-1, a] + alpha * (cum_reward - Q[order-1, ranking-1, a])
재현 과정
python script
secretary_problem_case_monte_carlo_control.py
에 아래 코드와 같이 print() 코드 추가오류 내용
기대 결과
참고 자료