train with margin auto