Skip to content

Instantly share code, notes, and snippets.

@suddhu
suddhu / pytorch_minkowski_conda.sh
Last active September 13, 2022 14:18
PyTorch + CUDA + MinkowskiEngine setup
conda install pytorch=1.8.1 torchvision cudatoolkit=10.1 -c pytorch -c conda-forge
export CXX=g++-7
export CUDA_HOME=/usr # verify CUDA location via $CUDA_HOME/nvcc --version
pip install -U git+https://github.com/NVIDIA/MinkowskiEngine -v --no-deps --install-option="--blas_include_dirs=${CONDA_PREFIX}/include" --install-option="--blas=openblas"
@suddhu
suddhu / n_sphere_euclidean_test.py
Created March 16, 2022 20:29
Computing average pairwise L2 distances over unit n-sphere (while varying n)
import numpy as np
from sklearn.metrics.pairwise import euclidean_distances
import matplotlib.pyplot as plt
import tqdm
def sample_spherical(npoints, ndim=3):
vec = np.random.randn(npoints, ndim)
vec /= np.linalg.norm(vec, axis = 1, keepdims = True)
return vec
@suddhu
suddhu / poly_regularizer.py
Created November 20, 2019 18:43
Python script that optimizes an input 2D point set to a regular n-sided polygon
#!/usr/bin/env python
# Sudharshan Suresh, Wei Dong, Nov 2019
# Given input ordered point set, regularize the polygon
import torch
import torch.nn as nn
import numpy as np
import matplotlib.pyplot as plt
import matplotlib
@suddhu
suddhu / handystuff.txt
Last active February 14, 2019 17:31
Handy stuff
Online
----------------------
Draw on PDFs - https://www.pdfzorro.com/EDIT/FUNCTIONS/_all.php?show=draw
Drawing - lucidchart.com
Drawing - draw.io, https://sketch.io/sketchpad/
GIF create/edit - https://ezgif.com/crop
latex - overleaf.com
latex table maker - https://www.tablesgenerator.com/
latex equation editor - https://www.codecogs.com/latex/eqneditor.php
latex equations to png - http://latex2png.com/