Using Custom Environments – pt.3
https://pythonprogramming.net/custom-environment-reinforcement-learning-stable-baselines-3-tutorial/
(OpenAI의 gym Environment 대신에) 자신의 custom Environment에서 RL을 수행.
어떤 Enviroment를 gym Environment에 맞게 변환해 주면 된다. (말이 쉽지 구현이 까다롭다….)
RL에서 가장 까다로운 2가지
– Environment의 observation을 가져오는 일 (data engineering)
– Agent에 적절한 rewards부여하기
Game = 그 자체가 가장 좋은 Enviroments = 뱀게임 (source)
위 게임을 gym environment로 변환하기 위해 필요한 구조
“””Custom Environment that follows gym interface”””
defining our action space and observation space.
action space
4 clear possible actions
observation space
게임이미지 보다는.. 어설프더라도 좀더 구체적인 수치.
뱀머리 위치, 사과 위치, 뱀몸통 위치,
reward
뱀길이
reset()
episode시작시 마다 (steps이 시작하기전에) 호출