Machine-learning approach could help robots assemble cellphones and other small parts in a manufacturing line.