Skip to content

Instantly share code, notes, and snippets.

View nzw0301's full-sized avatar
🐥
I may be slow to respond.

Kento Nozawa nzw0301

🐥
I may be slow to respond.
  • Preferred Networks, Inc. / Preferred Elements, Inc.
  • Japan
  • 20:13 (UTC +09:00)
View GitHub Profile
@nzw0301
nzw0301 / cbow_keras.py
Created April 11, 2016 03:06
reimplementation Continuous Bag–of–Words by Keras
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Activation, Embedding, TimeDistributedMerge
from keras.optimizers import SGD
from keras.utils import np_utils
def load_data(path):
id2word = []
word2id = {}
with open(path) as f:
@nzw0301
nzw0301 / keras_mnist_sample.ipynb
Last active April 12, 2016 13:02
keras+MNIST
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nzw0301
nzw0301 / strick-breaking-process.ipynb
Created March 13, 2016 11:16
alphaに応じた折った棒の総和の変化を可視化
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nzw0301
nzw0301 / .gitignore
Created January 13, 2016 18:05
nzwの.gitignore設定ファイル
*.aux
*.bbl
*.dvi
*.blg
*.fdb_latexmk
*.fls
*.log
*.synctex.gz
*.toc
*.lot
# coding: utf-8
import sys
import math
import numpy as np
from sklearn.feature_extraction.text import CountVectorizer
from sklearn import preprocessing
import scipy.special
fname = sys.argv[1]
@nzw0301
nzw0301 / mika_nn.py
Last active November 14, 2015 07:19
# coding: utf-8
import numpy as np
import sys
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.cross_validation import train_test_split
def logistic_function(mat):
return 1/(1+np.exp(-mat))
@nzw0301
nzw0301 / nn.py
Last active November 11, 2015 07:18
# coding: utf-8
import numpy as np
import sys
from sklearn.feature_extraction.text import CountVectorizer
def logistic_function(mat):
return 1/(1+np.exp(-mat))