Switching from physics Masters to machine learning PhD
I would suggest that you make as smooth and timely a transition as you can. The more dramatic a change you make, the more damage you risk doing to your network of relationships. Tell your advisor about your interests while making clear that you remain committed to the program you're in. 

Now, there are some advantageous tactics for studying several fields at once. First, modulate your commitments -- if half your courseload is in another department, that might be too much. Second, combine them wherever you can. Certainly you could train a neural network on solid models to recognize favorable heat dissipation, say.