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
#!/bin/sh | |
# stop execution on error | |
set -e | |
# installation of Oracle Java JDK. | |
sudo apt-get -y update | |
sudo apt-get -y install python-software-properties | |
sudo add-apt-repository -y ppa:webupd8team/java | |
sudo apt-get -y update |
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
#!/bin/bash | |
set -e | |
source activate tensorflow | |
# See what problems, models, and hyperparameter sets are available. | |
# You can easily swap between them (and add new ones). | |
#t2t-trainer --registry_help |
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 python | |
""" | |
https://twitter.com/ThomasCabaret84/status/1103324141493600256i | |
""" | |
import torch | |
def run(b, n=100, in_a_row=3): | |
""" | |
Expérience du lancer de pièce. | |
Une pièce parfaitement équilibrée est lancée `n` fois. |
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 python3 | |
import torch | |
def model_equals(model1, model2): | |
for p1, p2 in zip(model1.values(), model2.values()): | |
if p1.data.ne(p2.data).sum() > 0: | |
return False | |
return True | |
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
def scatter_hist(x, y, xlabel="", ylabel="", title="", left=0.1, width=0.65, | |
bottom=0.1, height=0.65, figsize=(8,8,), | |
ortho=False, | |
xbinwidth=None, | |
ybinwidth=None, | |
binwidth=5): | |
# scatter hist from [1] with small tweaks to work with different | |
# distributions on X and Y: | |
# [1]: https://matplotlib.org/examples/pylab_examples/scatter_hist.html | |