ai learns orientation to avoid losing