Skip to content

Instantly share code, notes, and snippets.

💭
architecting

Dillon Erb dte

💭
architecting
Block or report user

Report or block dte

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dte
dte / loopy_cosine_similarities.py
Created May 9, 2018
Vectorization and Broadcasting with Pytorch
View loopy_cosine_similarities.py
import torch
from torch.nn.functional import cosine_similarity
def embeddings_to_cosine_similarity_matrix(E):
"""
Converts a a tensor of n embeddings to an (n, n) tensor of similarities.
"""
similarities = [[cosine_similarity(a, b, dim=0) for a in E] for b in E]
similarities = list(map(torch.cat, similarities))
return torch.stack(similarities)
@dte
dte / install-cuda.sh
Created Jul 19, 2017
Install CUDA 8 on Ubuntu 16.04 / 16.10
View install-cuda.sh
#!/bin/bash
echo "Installing CUDA..."
# Only install if CUDA is not already installed.
if ! dpkg-query -W cuda; then
# The 16.04 installer works with 16.10.
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
dpkg -i ./cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
apt-get update
apt-get install cuda -y
fi
@dte
dte / install-CUDA-docker-nvidia-docker.sh
Created Jul 19, 2017
Install CUDA, Docker, and Nvidia Docker on a new Paperspace GPU machine
View install-CUDA-docker-nvidia-docker.sh
#!/bin/bash
# 1. Install CUDA
echo "Installing CUDA..."
# Only install if CUDA is not already installed.
if ! dpkg-query -W cuda; then
# The 16.04 installer works with 16.10.
curl -O http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
dpkg -i ./cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
apt-get update
apt-get install cuda -y
View keybase.md

Keybase proof

I hereby claim:

  • I am dte on github.
  • I am dte (https://keybase.io/dte) on keybase.
  • I have a public key ASBUHk4r10yK56bUqf0cZ9iYkVdIqehPtxMHsTcvtYp4awo

To claim this, I am signing this object:

View releaseTest.md

Release Notes

New Thing 2

7/16/2018

About this

New Thing 2

7/14/2018

About this

You can’t perform that action at this time.