add auto switching training/detecting modes