This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[11pt]{article} | |
\usepackage{amsmath,amssymb,tikz} | |
\usetikzlibrary{positioning} | |
\begin{document} | |
\begin{center} | |
\begin{tikzpicture} | |
\node (1) [align=center] {$\mathsf{EXPSPACE}$}; | |
\node (2) [align=center, below=3mm of 1] {$\mathsf{MA}_{\mathsf{EXP}}$}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Quick script I ran to visualuze some A2C results. Just run `python plot.py` in the same directory | |
as where the stuff in `files` is located. | |
""" | |
import argparse, csv, os, pickle, sys, matplotlib | |
from os.path import join | |
matplotlib.use('Agg') | |
import matplotlib.pyplot as plt | |
plt.style.use('seaborn-darkgrid') | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
For the BAIR Blog post. | |
(c) 2018 by Daniel Seita (and Michael Laskey). | |
""" | |
import numpy as np | |
import cv2 | |
def depth_to_3ch(img, cutoff): | |
"""Useful to turn the background into black into the depth images. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import copy, cv2, os, sys, pickle, time | |
import numpy as np | |
from os.path import join | |
TARGET = 'tmp/' | |
RAW_PICKLE_FILE = 'data_raw_115_items.pkl' | |
def prepare_data(): | |
"""Create the appropriate data for PyTorch using `ImageFolder`. From: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import torch.nn as nn | |
import torch.optim as optim | |
from torch.optim import lr_scheduler | |
import torchvision.models as models | |
from torchvision import datasets, transforms | |
import copy, cv2, os, sys, pickle, time | |
import numpy as np | |
from os.path import join |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I am testing different PyTorch transforms on my data, and saving sample | |
images as they are loaded during training. See examples below. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Some exception testing. | |
The code in the `try` block will stop as soon as any exception is encountered. | |
https://realpython.com/python-exceptions/ | |
https://realpython.com/the-most-diabolical-python-antipattern/ | |
""" | |
a = 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
How we might sample from a log-uniform distribution | |
https://stats.stackexchange.com/questions/155552/what-does-log-uniformly-distribution-mean | |
Only run one of these three cases at a time, otherwise the plots update each | |
other. Run with these versions: | |
matplotlib 3.2.1 | |
numpy 1.18.3 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gym | |
import numpy as np | |
import imageio | |
# Make the environment and the initial observation `o`. | |
env_name = 'Walker2d-v3' | |
env = gym.make(env_name) | |
obs_dim = env.observation_space.shape | |
act_dim = env.action_space.shape[0] | |
act_limit = env.action_space.high[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib | |
matplotlib.use('Agg') | |
import matplotlib.pyplot as plt | |
plt.style.use('seaborn') | |
import numpy as np | |
nrows, ncols = 1, 2 | |
fig, ax = plt.subplots(nrows, ncols, sharey=False, squeeze=True, figsize=(9*ncols, 6*nrows)) | |
x = np.arange(100) | |
y0 = x + np.random.normal(loc=0.0, scale=10.0, size=100) |
OlderNewer