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 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 | |
import itertools | |
def Amat(kernel, size): | |
assert kernel.shape[0] == kernel.shape[1] | |
ksize = kernel.shape[0] | |
assert ksize % 2 | |
osize = (size + 1 - ksize) | |
A = np.zeros((osize ** 2, size ** 2)) | |
pos = lambda _1, _2, s: _1 * s + _2 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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
def sample_swap(shape): | |
b, c, h, w = shape | |
left = np.arange(0, w//2) | |
right = np.arange(w//2, w) | |
flip = np.random.uniform(size=(b, 1)) > .5 | |
b = np.arange(b)[:, None, None, None] | |
c = np.arange(c)[None, :, None, None] | |
h = np.arange(h)[None, None, :, None] | |
w = np.concatenate([left+flip*(w//2), right-flip*(w//2)], -1) | |
w = w[:, None, None, :] |
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
def random_subimages_idx(n, d1, d2, h, w): | |
hs = np.random.randint(d1-h, size=n) | |
ws = np.random.randint(d2-w, size=n) | |
grid = np.meshgrid(np.arange(h), np.arange(w), indexing='ij') | |
i = np.tile(np.arange(n)[:, None, None], (h, w)) | |
xs = grid[0]+hs[:, None, None] | |
ys = grid[1]+ws[:, None, None] | |
return i, xs, ys | |
def random_subimages(images, h, w): |
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
git secret hide && git add $(git secret list | awk -v ext=${SECRETS_EXTENSION:-secret} '{print $1"."ext}') |
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
curl -fsSL get.docker.com | sh \ | |
&& sudo curl -L https://github.com/docker/compose/releases/download/1.20.1/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose \ | |
&& sudo chmod +x /usr/local/bin/docker-compose |
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
\newif\ifIncludeAuthorNotes | |
% Comment the below line to remove notes from text | |
\IncludeAuthorNotestrue | |
\DeclareRobustCommand{\note}[1]{ | |
\ifIncludeAuthorNotes | |
% the below line skips are intentional and force comment to be on a separate line | |
\textcolor{gray}{/* #1 */} |
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
xkb_keymap { | |
xkb_keycodes "(unnamed)" { | |
minimum = 8; | |
maximum = 255; | |
<ESC> = 9; | |
<AE01> = 10; | |
<AE02> = 11; | |
<AE03> = 12; | |
<AE04> = 13; | |
<AE05> = 14; |