Leveraging viscous Hamilton-Jacobi PDEs for uncertainty quantification in scientific machine learning