init pattern learn