# simulated batch of images
x = torch.rand(64, 3, 224, 224)
# or some number of layers up the convolutional stack
x = torch.rand(64, 256, 32, 32)
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
lst1 = [1,2,3,4,5,6,7] | |
lst2 = [4,5,6,7,1,2,3] | |
def rotation(lst1, lst2): | |
# check equal length | |
if len(lst1) != len(lst2): | |
return False | |
# keys | |
key = lst1[0] # first element of lst1 |
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 import sin,cos,tan,arcsin,arccos,arctan, pi, modf | |
from datetime import datetime | |
def Length_of_day(latitude,day_of_year): | |
""" | |
latitude = latitude in degrees (eg. 39.3292 for Athens Ohio) | |
Example: | |
import datetime | |
day_of_year = datetime.datetime.now().timetuple().tm_yday |
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
# rename files sequentially | |
num=0; for i in *; do mv "$i" "$(printf 'hello_%04d' $num).${i#*.}"; ((num++)); done |
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 interactive_histogram(df,col,n_bins,bin_range,title,x_axis_label,x_tooltip): | |
"""Plot interactive histogram using bokeh. | |
df: pandas dataframe | |
col: column of panda dataframe to plot (eg. age of users) | |
n_bins: number of bins, e.g. 9 | |
bin_range: list with min and max value. e.g. [10,100] age of users. | |
title: title of plot. e.g. 'Airnb Users Age Distribution' | |
x_axis_label: x axis label. e.g. 'Age (years)'. | |
x_tooltip: x axis tooltip string. e.g. 'Age' |
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
// Bookmark any webpage and change content with this javascript | |
javascript:top.location=%22http://htmlpreview.github.com/?%22+document.URL |
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
" Settings | |
map "b" scrollToBottom | |
map "," previousTab | |
map "." nextTab | |
let blacklists = [ "https://*.overleaf.com/*", "*://localhost:*", "*://codepen.io/*", "*://draw.io/*", "*://*slack.com/*", "*://codesandbox.io/*", "*://codewars.com/*", "*://discordapp.com/*", "://gitter.im/*"] |
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
let scrollstep = 120 | |
" Settings | |
let blacklists = [ "*://localhost.com*/*", "*://localhost:*", "*://codepen.io/*", "*://draw.io/*", "*://*slack.com/*", "*://codesandbox.io/*", "*://codewars.com/*", "*://discordapp.com/*", "://gitter.im/*"] |
NewerOlder