from Hacker News

Show HN: Math to Code – Interactive NumPy tutorial for engineers

by vthommeret on 6/13/20, 10:38 PM with 33 comments

  • by vthommeret on 6/13/20, 10:38 PM

    Math to Code is an interactive Python tutorial (all client-side) to teach engineers how to implement math in papers.

    I was inspired to create it while taking the Fast.ai course and seeing Jeremy Howard share [0] how a "complicated" Frobenius norm equation could be implemented in a single line of Python.

    Math to Code uses the Skulpt library to interpret Python in JavaScript.

    It's open source here: https://github.com/vthommeret/mathtocode

    I would appreciate any and all feedback!

    [0] https://youtu.be/4u8FxNEDUeg?t=1390

    > It's time to start reading papers. And papers look something like this, which if you're anything like me, that's terrifying. And I'm not going to lie, it's still the case when I start looking at a new paper, every single time, I think, I'm not smart enough to understand this. I just can't get past that immediate reaction. So I just look at this stuff and I go, that's not something I understand. > But then I remember, this is the Adam paper and you've all seen Adam implemented in one cell of Microsoft Excel. > 1. Even familiar stuff looks complex in a paper! > 2. Papers are important for deep learning beyond the basics, but hard to read. > 3. Learn to pronounce Greek letters.

  • by neil_s on 6/14/20, 5:02 AM

    Neat! I know python and wanted a quick primer in NumPy syntax recently for a quick data analysis, this is perfect. Would be nice if the input box was automatically focused when advancing to the next question.
  • by nromiun on 6/14/20, 11:46 AM

    Nice. Here is another similar resource that was posted recently.

    1. https://github.com/Jam3/math-as-code/blob/master/PYTHON-READ...

    The HN thread:

    https://news.ycombinator.com/item?id=23507764

  • by Donckele on 6/14/20, 10:01 AM

    Good work! I’m learning, thank you.

    Feedback: Please autofocus to input box - it will be a smoother experience!

  • by barrenko on 6/14/20, 12:31 PM

    This is cool. Got a coding interview task recently, ended up doing the whole thing with numpy and pandas, it was quite fun, and it did not feel like "regular" coding at all. So all my data science research ended up no totally worthless.
  • by somethingsome on 6/13/20, 11:30 PM

    I was expecting some math but there is only a norm, I would be more interested in how to transfer from advanced math to code. example : what would be a good code abstraction for a Borel Space
  • by set92 on 6/14/20, 6:23 AM

    I had to access the solution for std because I missed the right position of 2, I put it after the parenthesis. And in Fnorm I had to check it in the comments because I didn't thought of the similarity with the m.prod() and the list.

    Is a cool experiment, and it could be good to lose the fear in papers. Maybe you could add some exercises with formulas or different papers that are a must read.

  • by rmelhem on 6/14/20, 2:33 AM

    amazing! i love interactive (and free) tutorials. I'm blogging every free resource I can in the data science roadmap. Will include yours as well. Anyone have any other tool like that for Numpy? I figured out one for SQL called sqlbolt.com, which is dope too!
  • by tchaffee on 6/14/20, 3:14 PM

    This was useful, although too basic for me. I would love to see you add many more exercises.
  • by rayraegah on 6/14/20, 1:30 AM

    For slide 12 the correct answer[0] threw an error the first time but couldn't reproduce it.

    [0] https://pastebin.com/raw/AivpKE3u

  • by sharemywin on 6/13/20, 11:18 PM

    Got stuck would be nice to get right answer like a help button
  • by vthommeret on 6/14/20, 6:19 PM

    Based on the feedback, Math to Code now includes a Show solution button which lets you toggle a solution on and off if you get stuck!
  • by jackge on 6/14/20, 3:03 PM

    Useless, since based on Python 2.* interpreter (and this is not indicated anywhere) : "Skulpt is a Javascript implementation of Python 2.x." Nearly nothing of this runs on Python 3.
  • by jackge on 6/14/20, 3:07 PM

    Useless, since based on Python 2. (and this is nowhere indicated) - the user string is interpreted with Sculpt https://github.com/skulpt/skulpt: Skulpt is a Javascript implementation of Python 2.x. Nothing of this runs on current Python 3.*, providing this kind of tutorials is confucing learners.