## Finding the Mode of an Empirical Continuous Distribution

Posted 2021-03-02 • Last updated 2021-10-21

You can find the mode of an empirical continuous distribution by plotting the histogram and looking for the maximum bin.

## NumPy All: Understanding np.all()

Posted 2021-02-25 • Last updated 2021-10-21

The np.all() function tests whether all elements in a NumPy array evaluate to true.

## Binary Cross Entropy Explained

Posted 2021-02-22 • Last updated 2021-10-21

A simple NumPy implementation of the binary cross entropy loss function and some intuition about why it works.

## Filtering DataFrames with the .query() Method in Pandas

Posted 2021-02-19 • Last updated 2021-10-15

Pandas provides a .query() method on DataFrame’s with a convenient string syntax for filtering DataFrames. This post describes the method and gives simple usage examples.

## Linear Interpolation in Python: An np.interp() Example

Posted 2021-02-15 • Last updated 2021-10-21

It’s easy to linearly interpolate a 1-dimensional set of points in Python using the np.interp() function from NumPy.

## NumPy Meshgrid: Understanding np.meshgrid()

Posted 2021-02-09 • Last updated 2021-10-21

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.

## SageMaker Studio Quick Start

Posted 2021-02-08 • Last updated 2021-10-21

A step-by-step quick start guide for SageMaker Studio. Start a Studio session, launch a notebook on a GPU instance and run object detection inference with a detectron2 pre-trained model.

## PyTorch One Hot Encoding

Posted 2021-02-02 • Last updated 2021-10-14

PyTorch has a one_hot() function for converting class indices to one-hot encoded targets.

Posted 2021-01-30 • Last updated 2021-10-21

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.

## The PyTorch Softmax Function

Posted 2021-01-29 • Last updated 2021-10-14

You can use the top-level torch.softmax() function from PyTorch for your softmax activation needs.

Connect

Contact

ben [at] sparrow [dot] dev

Email List