Take a functional programming class. Martin Odersky on Coursera now has a while track. It's Scale. If that matters. Functional programming is the blood-brain barrier between programming and math with lots of activity bringing the two closer. It may not be directly useful in Machine Learning type of math, but it's a strong foundation for parallel programming and multi-core programming due to the statelessness of pure functions. Good luck!