Machine learning of coarse-grained molecular force fields