Combining Physics With Machine Learning: Case Study Of Shape From Polarization