Hacker News new | past | comments | ask | show | jobs | submit login

Thanks for the feedback. I think I was being overly clever by trying to make the product example more complicated than just `m.prod()` similar to the `m.sum()` example, but as you mentioned I was fitting two concepts in one question — operating on an already manipulated variable in addition to the new operator.

I've simplified question 9 to just `m.prod()` from the previous solution of `(m * 3).prod()` for now.

Re: Methods vs. functions — I completely agree! I actually originally implemented Math to Code using Tensorflow.js (which was simpler than using a Python interpreter) where the syntax was:

  m.pow(2).sum().sqrt()
Vs.

  np.sqrt((m ** 2).sum())
I decided to go with NumPy + Python because I felt it would be more immediately applicable vs. just learning the Tensorflow.js syntax. Also Python allows operator overloading so you can just do `2 * m` vs. `m.mul(2)`.

PyTorch has a similarly clean syntax to Tensorflow.js and includes operator overloading, but there doesn't seem to be a PyTorch shim for Skulpt, but that would be a fun project.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: