Skip to content

Instantly share code, notes, and snippets.

View mainyaa's full-sized avatar

Kazuyuki Mori mainyaa

  • Topgate, Inc.
  • Tokyo, JP
View GitHub Profile
@mainyaa
mainyaa / ml-install.sh
Last active October 5, 2018 08:13
ML installation
#set -eux
PATH=$PATH:~/anaconda3/bin
# This is necessary to for apt to access HTTPS sources
sudo apt-get update && \
sudo apt-get install apt-transport-https
# Cuda support.
CUDA_VERSION=9.0.176
@mainyaa
mainyaa / jupyter.service
Created June 15, 2018 01:23
kaggle kernel jupyter notebook systemd conf file
[Unit]
Description=Jupyter Service
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
Restart=on-failure
ExecStartPre=-/usr/bin/docker stop jupyter
ExecStartPre=-/usr/bin/docker rm jupyter
from sklearn.externals import joblib
def save_model(model, name):
'''
saves trained model
'''
joblib.dump(model, name)
def load_model(name):
@mainyaa
mainyaa / README.md
Last active September 8, 2017 03:58

Google Cloud ML Engineのメモリを調べてみた

https://cloud.google.com/ml-engine/docs/concepts/training-overview

Even though the exact specifications of the machine types are subject to change at any time, you can compare them in terms of relative capability. The following table uses rough "t-shirt" sizing to describe the machine types.

ココらへんがいまいち曖昧なので調べてみた

trainer/task.py

@mainyaa
mainyaa / compile_ios_tensorflow.sh.diff
Created December 5, 2016 01:53
Tensorflow r0.12 ios example batch for macOS Sierra
diff --git i/tensorflow/contrib/makefile/compile_ios_tensorflow.sh w/tensorflow/contrib/makefile/compile_ios_tensorflow.sh
index 61ab844..e2bcf5a 100755
--- i/tensorflow/contrib/makefile/compile_ios_tensorflow.sh
+++ w/tensorflow/contrib/makefile/compile_ios_tensorflow.sh
@@ -72,19 +72,10 @@ then
exit 1
fi
-make -f tensorflow/contrib/makefile/Makefile \
-TARGET=IOS IOS_ARCH=X86_64 LIB_NAME=${LIB_PREFIX}-x86_64.a OPTFLAGS="$1" $2 $3
@mainyaa
mainyaa / _NOTICE.md
Created October 11, 2016 02:07 — forked from nikitakit/_NOTICE.md
Restoring TensorFlow Models
@mainyaa
mainyaa / colorbar.patch
Created November 16, 2015 07:52
ffmpegのDecklink使用時のno signalのカラーバーを黒画面にする
diff --git libavdevice/decklink_dec.cpp libavdevice/decklink_dec.cpp
index 747f47e..d43faed 100644
--- libavdevice/decklink_dec.cpp
+++ libavdevice/decklink_dec.cpp
@@ -235,8 +235,8 @@ HRESULT decklink_input_callback::VideoInputFrameArrived(
if (videoFrame->GetFlags() & bmdFrameHasNoInputSource) {
if (videoFrame->GetPixelFormat() == bmdFormat8BitYUV) {
unsigned bars[8] = {
- 0xEA80EA80, 0xD292D210, 0xA910A9A5, 0x90229035,
- 0x6ADD6ACA, 0x51EF515A, 0x286D28EF, 0x10801080 };
@mainyaa
mainyaa / README.md
Last active November 16, 2015 11:31
xls2csv.rb

xls2csv

Installation:

`gem install roo-xls`

Usage

`ruby xls2csv.rb ~/Downloads/hoge.xls`
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<link rel="stylesheet" media="all" href="http://marianoguerra.github.io/json.human.js/css/json.human.css" />
<link rel="stylesheet" media="all" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.16.0/codemirror.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.16.0/codemirror.min.js"></script>
<script src="http://marianoguerra.github.io/json.human.js/lib/crel.js"></script>
# The 'other' host
REMOTE_IP=192.168.122.189
# Name of the bridge
BRIDGE_NAME=docker0
# Bridge address
BRIDGE_ADDRESS=172.16.42.2/24
# Deactivate the docker0 bridge
ip link set $BRIDGE_NAME down
# Remove the docker0 bridge