Machine-Learning Techniques for the Optimal Design of Acoustic Metamaterials