Skip to content

Instantly share code, notes, and snippets.

View jlertle's full-sized avatar

Jason Lee Ertle jlertle

  • Saint Petersburg, FL, US
View GitHub Profile
@jlertle
jlertle / rank_metrics.py
Created January 13, 2020 20:07 — forked from bwhite/rank_metrics.py
Ranking Metrics
"""Information Retrieval metrics
Useful Resources:
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt
http://www.nii.ac.jp/TechReports/05-014E.pdf
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf
Learning to Rank for Information Retrieval (Tie-Yan Liu)
"""
import numpy as np
@jlertle
jlertle / pyenv+virtualenv.md
Created January 13, 2020 19:16 — forked from eliangcs/pyenv+virtualenv.md
Cheatsheet: pyenv, virtualenvwrapper, and pip

Cheatsheet: pyenv, virtualenvwrapper, and pip

Installation (for Mac OS)

Install pyenv with brew

brew update
brew install pyenv
@jlertle
jlertle / storage.js
Created June 1, 2019 20:21 — forked from wilsonpage/storage.js
Simple localStorage like wrapper around indexeddb
function Storage(name) {
this.ready = new Promise((resolve, reject) => {
var request = window.indexedDB.open(location.origin);
request.onupgradeneeded = e => {
this.db = e.target.result;
this.db.createObjectStore('store');
};
request.onsuccess = e => {
@jlertle
jlertle / pb_viewer.py
Created April 8, 2019 22:35 — forked from jubjamie/pb_viewer.py
Load .pb into Tensorboard
import tensorflow as tf
from tensorflow.python.platform import gfile
with tf.Session() as sess:
model_filename ='PATH_TO_PB.pb'
with gfile.FastGFile(model_filename, 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
g_in = tf.import_graph_def(graph_def)
LOGDIR='/logs/tests/1/'
train_writer = tf.summary.FileWriter(LOGDIR)
@jlertle
jlertle / restore_tf_models.py
Created April 8, 2019 22:21 — forked from tokestermw/restore_tf_models.py
Restoring frozen models are hard in TensorFlow.
"""
Play with saving .
Closest:
https://github.com/tensorflow/tensorflow/issues/616#issuecomment-205620223
"""
import numpy as np
import tensorflow as tf
from tensorflow.python.platform import gfile
@jlertle
jlertle / install.sh
Created March 5, 2019 05:54 — forked from Danw33/install.sh
macOS Homebrew Install FFMPEG --with all options
brew install ffmpeg --with-chromaprint --with-fdk-aac --with-fontconfig --with-freetype --with-frei0r --with-game-music-emu --with-libass --with-libbluray --with-libbs2b --with-libcaca --with-libgsm --with-libmodplug --with-libsoxr --with-libssh --with-libvidstab --with-libvorbis --with-libvpx --with-opencore-amr --with-openh264 --with-openjpeg --with-openssl --with-opus --with-rtmpdump --with-rubberband --with-schroedinger --with-sdl2 --with-snappy --with-speex --with-tesseract --with-theora --with-tools --with-two-lame --with-wavpack --with-webp --with-x265 --with-xz --with-zeromq --with-zimg
@jlertle
jlertle / gradient_descent.py
Created February 22, 2019 18:19 — forked from felipessalvatore/gradient_descent.py
Plotting a 3d image of gradient descent in Python
#code adapted from http://tillbergmann.com/blog/python-gradient-descent.html
%matplotlib inline
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from scipy import stats
from sklearn.datasets.samples_generator import make_regression
@jlertle
jlertle / k8s_on_macos.sh
Last active February 13, 2019 23:30
k8s on macOS
# https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-with-homebrew-on-macos
# https://kubernetes.io/docs/tasks/tools/install-minikube
# https://codefresh.io/kubernetes-tutorial/local-kubernetes-mac-minikube-vs-docker-desktop/
brew update
brew install docker-machine-driver-hyperkit
sudo chown root:wheel /usr/local/opt/docker-machine-driver-hyperkit/bin/docker-machine-driver-hyperkit
sudo chmod u+s /usr/local/opt/docker-machine-driver-hyperkit/bin/docker-machine-driver-hyperkit
brew cask install minikube
minikube config set vm-driver hyperkit
# Reference:
https://www.cloudgear.net/blog/2015/5-minutes-kubernetes-setup/
# install homebrew and cask
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install virtualbox
brew cask install virtualbox
# install dockertoolbox
@jlertle
jlertle / register-jupyter-env
Last active February 8, 2019 02:20 — forked from thvitt/register-jupyter-env
Register a jupyter kernel for the current pyenv.
#!/bin/sh
if [ "$PYENV_VERSION" = "" ]
then
name=`basename "$VIRTUAL_ENV"`
python="$VIRTUALENV/bin/python"
else
name=`pyenv version-name`
python=`pyenv which python`
fi