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
.DS_store | |
### Jekyll ### | |
_site/ | |
.sass-cache | |
.jekyll-metadata | |
Gemfile.lock | |
.jekyll-cache/ | |
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 | |
# check color support | |
colors=$(tput colors) | |
if (($colors >= 8)); then | |
red='\033[0;31m' | |
nocolor='\033[00m' | |
else | |
red= | |
nocolor= |
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
function getArticleText() { | |
function textNodesUnder(node){ | |
var all = []; | |
for (node=node.firstChild;node;node=node.nextSibling){ | |
if (node.nodeType==3) all.push(node); | |
else all = all.concat(textNodesUnder(node)); | |
} | |
return all; | |
} | |
let textNodes = textNodesUnder(document); |
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 prettytable import PrettyTable | |
def count_parameters(model): | |
table = PrettyTable(["Modules", "Parameters"]) | |
total_params = 0 | |
for name, parameter in model.named_parameters(): | |
if not parameter.requires_grad: continue | |
param = parameter.numel() | |
table.add_row([name, param]) | |
total_params+=param |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.