Skip to content

Instantly share code, notes, and snippets.

Avatar

Ken Morishita mokemokechicken

View GitHub Profile
View stat.js
// https://github.com/numpy/numpy/blob/master/numpy/random/mtrand/distributions.c
// https://github.com/numpy/numpy/blob/master/numpy/random/mtrand/randomkit.c
function DistributionSampling(seed) {
// xorshift: https://sbfl.net/blog/2017/06/01/javascript-reproducible-random/
var state = {
x: 123456789,
y: 362436069,
z: 521288629,
w: seed || 88675123,
View scatter_with_colors_and_legends.py
p_list = np.argmax(api.predict(dataset.x), axis=1)
color_master = sns.color_palette()
colors = [color_master[ptn] for ptn in p_list]
names = api.predict_names()
g = sns.JointGrid("x", "y", data=zz)
g = g.plot_joint(plt.scatter, c=colors, label=p_list)
g = g.plot_marginals(sns.distplot, kde=True)
bb = g.ax_joint.viewLim
View find_files_including_null_bytes.sh
sudo find /usr /lib /etc -type f -size +100 \( -exec grep -q -P "[^\0]" {} \; -o -print \) | head
View q.py
"""
問:
あなたは
1. この質問に「いいえ」と正しく答えるか
2. この質問に「はい」と間違って答えるか
3. 教師に1万円を支払うか
のいずれかですか?
View transfer_money.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mokemokechicken
mokemokechicken / keras_mnist_vat.py
Last active Oct 21, 2020
Virtual Adversarial Training for MNIST with Keras
View keras_mnist_vat.py
# coding: utf8
"""
* VAT: https://arxiv.org/abs/1507.00677
# 参考にしたCode
Original: https://github.com/fchollet/keras/blob/master/examples/mnist_cnn.py
VAT: https://github.com/musyoku/vat/blob/master/vat.py
results example
---------------
View 2016-j1league-1st.csv
away_score away_team date home_score home_team score visitors
1 名古屋 02/27(土) 0 磐田 0-1 14333
1 川崎F 02/27(土) 0 広島 0-1 18120
1 福岡 02/27(土) 2 鳥栖 2-1 19762
2 浦和 02/27(土) 1 1-2 13416
2 新潟 02/27(土) 1 湘南 1-2 14058
2 甲府 02/27(土) 0 神戸 0-2 23862
1 仙台 02/27(土) 0 横浜FM 0-1 24898
1 大宮 02/27(土) 0 FC東京 0-1 25776
1 鹿島 02/28(日) 0 G大阪 0-1 32463
View for_bayesian_opt_article.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mokemokechicken
mokemokechicken / Dockerfile
Created Feb 23, 2016
Dockerfile about jupyter + tensorflow
View Dockerfile
From jupyter/datascience-notebook
RUN curl -k -L -O https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp34-none-linux_x86_64.whl && \
mv tensorflow-0.7.1-cp34-none-linux_x86_64.whl tensorflow-0.7.1-cp35-none-linux_x86_64.whl
RUN pip install tensorflow-0.7.1-cp35-none-linux_x86_64.whl
RUN /bin/bash -c "source activate /opt/conda/envs/python2/ && pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl"
@mokemokechicken
mokemokechicken / Dockerfile-jupyter-tensorflow
Created Feb 23, 2016
Dockerfile about Jupyter with tensorflow
View Dockerfile-jupyter-tensorflow
From jupyter/datascience-notebook
RUN curl -k -L -O https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp34-none-linux_x86_64.whl && \
mv tensorflow-0.7.1-cp34-none-linux_x86_64.whl tensorflow-0.7.1-cp35-none-linux_x86_64.whl
RUN pip install tensorflow-0.7.1-cp35-none-linux_x86_64.whl
RUN /bin/bash -c "source activate /opt/conda/envs/python2/ && pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl"