curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
This file contains hidden or 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
from .numpy_utils import subsample | |
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
def scatter_3d(X, sample_size=None, fig=None, subplot=None, title='X', xlabel='X', | |
ylabel='Y', zlabel='Z'): | |
""" | |
Create 3d scatterplot of N-by-3 array. | |
Inputs: |
This file contains hidden or 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 numpy as np | |
def subsample(x, n_samples, return_choices=False, replace=False): | |
""" | |
Randomly sample a subset of x. | |
Inputs: | |
x - The array to sample from. | |
n_samples - The number of samples to select from x. | |
return_choices - If True, returns an array of the random indices used to |
This file contains hidden or 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
from os import listdir | |
from os.path import join, isdir, isfile | |
from re import sub | |
from shutil import copy | |
def list_files(loc, return_dirs=False, return_files=True, recursive=False, valid_exts=None): | |
""" | |
Return a list of all filenames within a directory loc. | |
Inputs: |
This file contains hidden or 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 os | |
import tensorflow as tf | |
from tensorflow import keras as K | |
from tensorflow.keras.layers import Input, Conv2D, MaxPooling2D, UpSampling2D, concatenate | |
from tensorflow.keras.layers import LeakyReLU as LReLU | |
# for python2 | |
try: | |
FileNotFoundError | |
except NameError: |
This file contains hidden or 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
// if using Vue as standalone / script tag | |
Vue.options.delimiters = ['V{', '}V']; | |
// if using Vue with in-browser compilation / full-build | |
var instance = new Vue({ | |
el: '#id', | |
delimiters: ['V{', '}V'], | |
... | |
}) |
This file contains hidden or 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
# After installing npm, using the following command: | |
nvm ls-remote | |
# This returned `N/A` for me, indicating that it could not pull any valid versions of `node` from the remote | |
# server. This was likely due to it trying to access https urls without valid certificates. | |
# After adding the following to `.bashrc`: | |
export CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt |
This file contains hidden or 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
# list all devices | |
from tensorflow.python.client import device_lib | |
device_lib.list_local_devices() |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" /> | |
<title>Stripe Effect</title> | |
<style> | |
body { | |
padding: 25px; | |
} |
This file contains hidden or 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
// Add Anaconda Environment to Jupyter Notebook as Kernel | |
conda install ipykernel | |
python -m ipykernel install --user --name myenv --display-name "Python (myenv)" | |
// Actually, just install this and be done with it https://github.com/Anaconda-Platform/nb_conda_kernels | |
conda install -c conda-forge nb_conda_kernels |
NewerOlder