Manipulation of granular materials by learning particle interactions