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
# https://stackoverflow.com/questions/38160940/how-to-count-total-number-of-trainable-parameters-in-a-tensorflow-model | |
total_parameters = 0 | |
for variable in tf.trainable_variables(): | |
# shape is an array of tf.Dimension | |
shape = variable.get_shape() | |
# print("{}: {}".format(variable.name, shape)) | |
variable_parameters = 1 | |
for dim in shape: | |
variable_parameters *= dim.value | |
# print(variable_parameters) |
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 csv | |
def tf_smooth_csv(in_file, out_file, smoothingWeight=0.6): | |
count = 0 | |
last = -1 | |
with open(in_file) as csvfile: | |
with open(out_file, 'w') as out: | |
reader = csv.DictReader(csvfile, delimiter=',') | |
writer = csv.DictWriter(out, fieldnames=["Step", "Value"]) |
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 markdown2 import Markdown | |
import pdfkit | |
GITHUB_CSS = "a.anchor,ol,ul{padding-left:30px}dl dt,table tr th{font-weight:700}body{font-family:Helvetica,arial,sans-serif;font-size:14px;line-height:1.6;background-color:#fff;padding:30px}body>:first-child{margin-top:0!important}h1 p,h2 p,h3 p,h4 p,h5 p,h6 p,ol :first-child,ul :first-child{margin-top:0}body>:last-child{margin-bottom:0!important}blockquote>:last-child,dl dd>:last-child,dl dt>:last-child,ol :last-child,table tr td :last-child,table tr th :last-child,ul :last-child{margin-bottom:0}a{color:#4183C4}a.absent{color:#c00}h1,h2{color:#000}blockquote,h6{color:#777}a.anchor{display:block;margin-left:-30px;cursor:pointer;position:absolute;top:0;left:0;bottom:0}dl,dl dt,dl dt:first-child,hr,table,table tr{padding:0}h1,h2,h3,h4,h5,h6{margin:20px 0 10px;padding:0;font-weight:700;-webkit-font-smoothing:antialiased;cursor:text;position:relative}h1:hover a.anchor,h2:hover a.anchor,h3:hover a.anchor,h4:hover a.anchor,h5:hover a.anchor,h6:hover a.anchor{background |
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
% standalone um Bild zu rendern | |
% Fuer standalone luatex85 | |
% \RequirePackage{luatex85} | |
% \documentclass{standalone} | |
\documentclass{article} | |
\usepackage[dvipsnames,table]{xcolor} | |
\usepackage{tikz} | |
\usetikzlibrary{graphdrawing, graphs, backgrounds, fit, positioning, calc, arrows} | |
\usegdlibrary{layered} |
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
https://github.com/pyenv/pyenv/issues/94 | |
On MacOS you may need to set some env. vars. in order for the pyenv installation to pick up the homebrew tcl-tk. Check your brew info tcl-tk's caveats section for the exact values you should use. | |
pyenv uninstall 3.8.1 | |
export PATH="/usr/local/opt/tcl-tk/bin:$PATH" | |
export LDFLAGS="-L/usr/local/opt/tcl-tk/lib" | |
export CPPFLAGS="-I/usr/local/opt/tcl-tk/include" | |
export PKG_CONFIG_PATH="/usr/local/opt/tcl-tk/lib/pkgconfig" | |
pyenv install 3.8.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
import threading | |
from time import sleep | |
import schedule | |
class Notifier(threading.Thread): | |
def __init__(self): | |
super(Notifier, self).__init__() |
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
#!/bin/bash | |
alias ducks='du -cks * | sort -rn | head' |
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
#!/bin/bash | |
git config --global alias.ll 'log --oneline --graph --all ' | |
git config --global alias.st 'status ' | |
git config --global remote.origin.prune true | |
git config --global rerere.enabled=true | |
git config --global core.editor=vim | |
git config --global core.pager=less -F -X | |
git config --global diff.wsErrorHighlight all |
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
# Credit: | |
# https://stackoverflow.com/a/34467298/6180150 | |
# https://stackoverflow.com/a/9074343/6180150 | |
[alias] | |
lg = lg1 | |
lg1 = lg1-specific --all | |
lg2 = lg2-specific --all | |
lg3 = lg3-specific --all | |
lg1-specific = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' |
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
# https://superuser.com/questions/1418885/clear-jenkins-build-history-clear-build-yesterday/1418896 | |
def jobName = "JOB_NAME" | |
def job = Jenkins.instance.getItem(jobName) | |
job.getBuilds().each { it.delete() } | |
job.nextBuildNumber = 1 | |
job.save() |
OlderNewer