numpy

NumPy Meshgrid: Understanding np.meshgrid()

2021-02-09

You can create multi-dimensional coordinate arrays using the np.meshgrid() function, which is also available in PyTorch and TensorFlow. But watch out! PyTorch uses different indexing by default so the results might not be the same.

Numpy Pad: Understanding np.pad()

2021-01-30

The np.pad() function has a complex, powerful API. But basic usage is very simple and complex usage is achievable! This post shows you how to use NumPy pad and gives a couple examples.

NumPy Norm: Understanding np.linalg.norm()

2021-01-08

You can calculate the L1 and L2 norms of a vector or the Frobenius norm of a matrix in NumPy with np.linalg.norm(). This post explains the API and gives a few concrete usage examples.