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 | |
from torch.optim.lr_scheduler import CosineAnnealingLR | |
from torch.optim import SGD | |
import matplotlib.pyplot as plt | |
STEPS = 100 | |
optimizer = SGD([torch.tensor(1)], lr=1) | |
# Use a scheduler of your choice below. | |
# Great for debugging your own schedulers! |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/usr/bin/env bash | |
trap_exit() { | |
if [[ ! -o xtrace ]]; then | |
rm -rf "$tmp" | |
fi | |
} | |
tmp=$(mktemp -dt) |
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.pyplot as plt, numpy as np | |
from matplotlib.font_manager import FontProperties | |
# Load Apple Color Emoji font | |
prop = FontProperties(fname='/System/Library/Fonts/Apple Color Emoji.ttc') | |
# Set up plot | |
freqs = [301, 96, 53, 81, 42] | |
labels = ['😊', '😱', '😂', '😄', '😛'] | |
plt.figure(figsize=(12,8)) |
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
#!/usr/bin/env python | |
import sys, os | |
import glob | |
import numpy as np | |
import skimage.io as io | |
np.set_printoptions(precision=15) | |
files = glob.glob(os.path.join(sys.argv[1], "*.png")) |