View MNIST_for_ML_beginners.py
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 __future__ import print_function | |
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) | |
import tensorflow as tf | |
x = tf.placeholder(tf.float32, [None, 784]) | |
W = tf.Variable(tf.zeros([784, 10])) |
View deep_MNIST_for_experts.py
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 __future__ import print_function | |
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) | |
import tensorflow as tf | |
def weight_variable(shape): | |
initial = tf.truncated_normal(shape, stddev=0.1) | |
return tf.Variable(initial) |
View tensorflow_cxx_mnist_example.cpp
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
// -*- coding: utf-8 -*- | |
#include <iostream> | |
#include <fstream> | |
#include <memory> | |
#include <vector> | |
#include <cassert> | |
#include <cstdint> | |
#include <boost/iostreams/filtering_stream.hpp> | |
#include <boost/iostreams/filter/gzip.hpp> |
View tensorflow_save_graph.py
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 __future__ import print_function | |
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets('MNIST_data/', one_hot=True) | |
import tensorflow as tf | |
from tensorflow.python.framework.graph_util import convert_variables_to_constants | |
def train_and_save(): | |
x = tf.placeholder(tf.float32, [None, 784], name='x') |
View tensorflow_load_graph.py
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 __future__ import print_function | |
from tensorflow.examples.tutorials.mnist import input_data | |
mnist = input_data.read_data_sets('MNIST_data', one_hot=True) | |
import tensorflow as tf | |
def import_graph_def(): | |
with open('trained_graph.pb', 'rb') as f: | |
graph_def = tf.GraphDef() |
View copy_tensorflow_headers.sh
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 -eu | |
# -*- coding: utf-8 -*- | |
HEADER_DIR=/tmp/tensorflow/include | |
if [ ! -e $HEADER_DIR ]; | |
then | |
mkdir -p $HEADER_DIR | |
fi |
View docker-nsenter
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 | |
container_id=$1 | |
if [ -z $container_id ]; then | |
echo "usage: sudo docker-nsenter <container_id> [args ...]" | |
exit 1 | |
fi | |
target=`docker inspect --format '{{.State.Pid}}' $container_id` | |
nsenter --mount --uts --ipc --net --pid --target $target ${@:2} |
View get_authkey.sh
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 | |
# -*- coding: utf-8 -*- | |
PLAYER_URL='http://radiko.jp/player/swf/player_4.1.0.00.swf' | |
wget $PLAYER_URL -O player.swf | |
swfextract -b 14 -o authkey.png player.swf | |
rm -f player.swf |
View bashrc_min2
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
export PS1="-- \[\033[0;31m\]\u@\h \[\033[1;34m\]\w \[\033[0m\]-- \n> " | |
alias ls='ls -hF --color=tty' | |
alias rm='rm -i' | |
alias cp='cp -i' | |
alias mv='mv -i' | |
alias less='less -r' # raw control characters | |
alias grep='grep --color' # show differences in colourx | |
alias ll='ls -l -A' # long list | |
alias la='ls -A' # all but . and .. |
View ssh_config
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
GSSAPIAuthentication no | |
AddressFamily inet | |
Compression yes | |
CompressionLevel 9 | |
ServerAliveInterval 100 | |
ForwardX11 yes | |
ForwardX11Trusted yes | |
ForwardAgent yes |
NewerOlder