News for hackers. Stuff that matters.
Re:Ask HN: Why is Python so popular for ML/DS? by hahahaha23 on Monday January 22, 2018 @05:10PM (#16208457)
To be honest, I don’t understand its popularity.

For example, I was trying to understand a batch normalization function defined as

def batchnorm_forward(x, gamma, beta, eps):

I can’t tell if gamma/beta are scalar or vector?

Re:Ask HN: Why is Python so popular for ML/DS? by tedmiston on Tuesday January 23, 2018 @07:13PM (#16219180)
We have type annotations in python now which can be used to clarify data types in function signatures.

https://docs.python.org/3/library/typing.html

Re:Ask HN: Why is Python so popular for ML/DS? by brorfred on Tuesday January 23, 2018 @03:37PM (#16217422)
Wouldn't the default assumption be that you can use either a scalar or vector?
Re:Ask HN: Why is Python so popular for ML/DS? by happy-go-lucky on Tuesday January 23, 2018 @04:38PM (#16217971)
You could try np.isscalar() and np.array().ndim in NumPy.