Skip to content

Instantly share code, notes, and snippets.

View rfdickerson's full-sized avatar
:octocat:
Reticulating splines

Robert F. Dickerson rfdickerson

:octocat:
Reticulating splines
View GitHub Profile
@rfdickerson
rfdickerson / newton.py
Created February 27, 2021 20:54
ik- newton
@jit
def forward(state):
return forward_ik(state["angles"], state["lengths"])
@jit
def checker(state):
end_location = forward(state)
distance = jnp.linalg.norm(end_location - state["target"])
return distance > 0.00001
@rfdickerson
rfdickerson / forward.py
Last active February 27, 2021 20:52
ik-forward
@jit
def forward_ik(angles, lengths):
x = jnp.cos(angles)
y = jnp.sin(angles)
d = jnp.stack([x,y], axis=0)
return jnp.dot(d, lengths)
@jit
def forward(state):
return forward_ik(state["angles"], state["lengths"])
@rfdickerson
rfdickerson / ik.py
Last active January 11, 2021 14:54
ik
import numpy as np
# forward kinematics
def forward(theta, l):
ex = np.dot(l, np.cos(theta))
ey = np.dot(l, np.sin(theta))
return np.array([ex, ey])
job "toaster-mnist" {
datacenters = ["us-aep-1-prod-multipaas-1"]
type = "batch"
group "toaster-mnist-group" {
task "toaster-mnist-task" {
driver = "docker"
@rfdickerson
rfdickerson / opencv-build.sh
Created January 26, 2019 15:49
Build OpenCV with CUDA
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D WITH_CUDA=ON \
-D ENABLE_FAST_MATH=1 \
-D CUDA_FAST_MATH=1 \
-D WITH_CUBLAS=1 \
-D INSTALL_C_EXAMPLES=OFF \
-D OPENCV_ENABLE_NONFREE=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/Libraries/opencv_contrib-4.0.1/modules \
@rfdickerson
rfdickerson / kd_tree.cpp
Created July 1, 2018 19:53
KD Tree implementation
#include <iostream>
#include <algorithm>
#include <vector>
#include <iterator>
#include <memory>
using namespace std;
typedef vector<float> Point;
@rfdickerson
rfdickerson / environment.yml
Created March 28, 2018 15:40
Sample Environment.yml
name: travelbug
channels:
- anaconda
- conda-forge
- defaults
dependencies:
- pandas
- pyarrow
- arrow-cpp
- parquet-cpp
@rfdickerson
rfdickerson / cool-minion.tex
Created March 5, 2018 19:18
LaTeX with Minion Font
\documentclass{amsart}
\usepackage{amssymb}
\usepackage[no-math]{fontspec}
%\usepackage[mathlf,footnotefigures]{MinionPro}
\usepackage{amsmath}
\usepackage{MnSymbol}
\usepackage[USenglish]{babel}
@rfdickerson
rfdickerson / sphere.m
Created September 24, 2017 00:55
Sphere Matlab
width = 1024;
height = 1024;
numpixels = width * height;
x = linspace(-1, 1, width);
y = linspace(-1, 1, height);
@rfdickerson
rfdickerson / gravity.py
Created September 14, 2017 02:53
tensorflow gravity
from datetime import datetime
import tensorflow as tf
now = datetime.utcnow().strftime("%Y%m%d%H%M%S")
root_logdir = "tf_logs"
logdir = "{}/run-{}/".format(root_logdir, now)
n_epochs = 20
time_step = 0.1