An entry level description of various datasets and their accessibility.
Datasets housed within sklearn - http://scikit-learn.org/stable/datasets/index.html
(examples - mnist number images, boston housing prices, iris types, Titantic survivors)
| # to get mujoco-py to install with headless rendering without sudo access | |
| ############################## | |
| # 1) first download and install mujoco according to instructions from https://github.com/deepmind/mujoco/ | |
| ############################## | |
| # 2) add environment variables to your bashrc | |
| # importantly, this should be done before installing mujoco-py | |
| export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/$USER/.mujoco/mujoco210/bin | |
| export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/nvidia |
| ''' | |
| This script saves each topic in a bagfile as a csv. | |
| Accepts a filename as an optional argument. Operates on all bagfiles in current directory if no argument provided | |
| Originally Written by Nick Speal in May 2013 at McGill University's Aerospace Mechatronics Laboratory | |
| Modified by J.Hansen in 2021 | |
| ''' | |
| import rosbag, sys, csv |
| import numpy as np | |
| import os | |
| import sys | |
| # hours_per_time_step should be greater than 1 | |
| hours_per_step = 2 | |
| class PainModel(): | |
| def __init__(self, seed): | |
| # pain -1 is bad |
| # from KK | |
| from copy import deepcopy | |
| import time | |
| import os | |
| import torch | |
| import torch.nn as nn | |
| from torch.nn.utils.clip_grad import clip_grad_norm | |
| import torch.nn.functional as F | |
| import torch.optim as optim | |
| from torch.autograd import Variable |
| # from KK | |
| import torch | |
| from torch.autograd import Variable | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import torch.nn.init as init | |
| from IPython import embed | |
| dtype = torch.FloatTensor | |
| input_size, hidden_size, output_size = 1,128,1 |
| import os, sys | |
| from glob import glob | |
| from IPython import embed | |
| from subprocess import call | |
| # example <a href='catalog.html?dataset=NOAA/CBOFS/MODELS/201710/nos.cbofs.stations.nowcast.20171031.t18z.nc'><tt>nos.cbofs.stations.nowcast.20171031.t18z.nc</tt></a></td>^M | |
| fpaths = glob('/localdata/jhansen/thredds/opendap.co-ops.nos.noaa.gov/thredds/catalog/NOAA/*') | |
| output = '/localdata/jhansen/thredds/ncfiles' | |
| fileServer = 'https://opendap.co-ops.nos.noaa.gov/thredds/fileServer/' | |
| for station in fpaths: | |
| # only get stations which have fairly open oceans |
| name: py-ros | |
| channels: | |
| - defaults | |
| dependencies: | |
| - backports=1.0=py27h63c9359_1 | |
| - backports.shutil_get_terminal_size=1.0.0=py27h5bc021e_2 | |
| - ca-certificates=2017.08.26=h1d4fec5_0 | |
| - certifi=2017.7.27.1=py27h9ceb091_0 | |
| - decorator=4.1.2=py27h1544723_0 | |
| - enum34=1.1.6=py27h99a27e9_1 |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| # example taken from Jake Vanderplas' talk "Statistics for Hackers" | |
| def is_statistically_significant_shuffle(s1,s2,trials=10000,do_plot=False,null_hyp=.05): | |
| # find difference of means to test null hyp | |
| odiff = np.mean(s1)-np.mean(s2) | |
| # join the lists together | |
| a = np.array(s1+s2) |
An entry level description of various datasets and their accessibility.
Datasets housed within sklearn - http://scikit-learn.org/stable/datasets/index.html
(examples - mnist number images, boston housing prices, iris types, Titantic survivors)
| import numpy | |
| import time | |
| import matplotlib.pyplot as plt | |
| import numpy as np | |
| from copy import deepcopy | |
| import os, sys | |
| from scipy.misc import face | |
| import GPy | |
| from skimage.transform import resize | |
| from skimage.filters import gaussian_filter |