Skip to content

Instantly share code, notes, and snippets.

Avatar

yrevar yrevar

  • San Francisco Bay Area
View GitHub Profile
@yrevar
yrevar / unittest_example.py
Created Jul 15, 2020
python unittest example
View unittest_example.py
# python3 -m unittest_example
# python3 -m unittest -v unittest_example
# python3 -m unittest -v unittest_example.Numbers.test_odd
import unittest
class Numbers(unittest.TestCase):
def test_20(self):
x = 13
@yrevar
yrevar / mlp_2d_fn_approx.ipynb
Created Apr 17, 2020
MLP 2d function approximation
View mlp_2d_fn_approx.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yrevar
yrevar / Matplotlib Gif Maker.ipynb
Created Mar 4, 2020
Matplotlib plots to gif maker
View Matplotlib Gif Maker.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View NavigationGridView.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View matplotlib_connectionpatch_problem_workaround.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View matplotlib_connectionpatch_problem.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Binomial Distribution.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Differentiable Value Iteration (PyTorch).ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View JupyterBoilerPlate.py
import os
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import matplotlib as mpl
# plot title
mpl.rcParams['axes.titlesize'] = 18
@yrevar
yrevar / imagenet1000_clsid_to_labels.txt
Created Jan 21, 2019
text: imagenet 1000 class id to human readable labels. (Sergey Zagoruyko, Torch Tutorials GitHub Repository; Retrieved from: https://github.com/torch/tutorials/blob/master/7_imagenet_classification/synset_words.txt)
View imagenet1000_clsid_to_labels.txt
{n01440764: 'tench, Tinca tinca',
n01443537: 'goldfish, Carassius auratus',
n01484850: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
n01491361: 'tiger shark, Galeocerdo cuvieri',
n01494475: 'hammerhead, hammerhead shark',
n01496331: 'electric ray, crampfish, numbfish, torpedo',
n01498041: 'stingray',
n01514668: 'cock',
n01514859: 'hen',
n01518878: 'ostrich, Struthio camelus',