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
data = open('./input.txt').read().splitlines() | |
data = list(map(lambda i: (i[0], int(i[1:])), data)) | |
def turn(d,x,y,n): | |
while n: | |
if d == 'R': | |
x, y = y, -x | |
else: | |
x, y = -y, x | |
n -=1 |
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
from itertools import product | |
def neigh(row,col, part2=True): | |
out = [] | |
for (i,j) in product((-1,0,1), (-1,0,1)): | |
if not i and not j: continue | |
r,c = row,col | |
while not (r+i)//row_len and not (c+j)//col_len: | |
if d[r+i][c+j] == '.' and part2: | |
r+=i |
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
//Adi | |
(function() { | |
'use strict'; | |
document.getElementsByTagName("body")[0].setAttribute("style", "margin:auto; max-width: 1500px;"); | |
})(); |
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
python -c 'import tensorflow as tf; print(tf.sysconfig.get_lib() + "/python/_pywrap_tensorflow_internal.so")' | xargs ldd |
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 json | |
import sys | |
data_type = sys.argv[1] | |
t = json.load(open('./captions_' + data_type + '2014.json')) | |
ta = t[u'annotations'] | |
ids = {} | |
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 | |
assert torch.backends.cudnn.enabled == True | |
print(torch.backends.cudnn.version()) |
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
#Step1: | |
mkdir /hdd/ImageNet | |
cd /hdd/ImageNet | |
#Step2: Download ImageNet data | |
#Download training images (about 50GB) | |
wget -c http://www.image-net.org/challenges/LSVRC/2012/nonpub/ILSVRC2012_img_train.tar & |
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
apt list --installed | grep latex | cut -d '/' -f 1 | xargs -L 1 -P 1 dpkg --force-all -P |
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
{ | |
"notebook:hide-cell-ouputs": { | |
"keys": [ | |
"L" | |
], | |
"command": "notebook:hide-cell-ouputs", | |
"selector": ".jp-Notebook:focus", | |
} | |
"notebook:show-cell-ouputs": { | |
"keys": [ |
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 numpy as np | |
import pandas as pd | |
import json | |
from glob import glob | |
import matplotlib | |
import matplotlib.pyplot as plt | |
%matplotlib inline | |
import seaborn as sns | |
sns.set(style="ticks" , palette='Set2') | |
sns.despine() |
NewerOlder