Cross Entropy Loss in PyTorch

Posted 2020-07-24 • Last updated 2021-10-14

Cross entropy loss in PyTorch can be a little confusing. Here is a simple explanation of how it works for people who get stuck.

Pairwise Distance in NumPy

Posted 2020-06-01 • Last updated 2021-10-15

You can do vectorized pairwise distance calculations in NumPy (without using SciPy). This lets you extend pairwise computations to other kinds of functions.

Object Spread Operator for Python

Posted 2019-03-17 • Last updated 2021-10-15

The object spread operator is a useful pattern in JavaScript. You can do something similar in Python.

text message sns

Sending a Text Message with AWS SNS

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

SNS is AWS’s pub-sub service. It’s useful for sending and receiving alerts for events you care about. It can also be used to send SMS messages.

Some Cool IPython Tips

Posted 2017-02-25 • Last updated 2021-10-15

The IPython shell is a fast way to evaluate small bits of code. It also functions as a mighty fine calculator.

Connect

Contact

ben [at] sparrow [dot] dev

Email List