Learning task-state representations