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
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
# 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) |
NewerOlder