高橋 啓治郎 - 1977年生まれ
コンシューマーゲーム業界にて10年間の開発経験を持つゲームプログラマーです。ゲームプログラミング全般に経験を持ち、中でもグラフィックスプログラミング、AIプログラミングを得意としています。
現在は iPhone/iPad アプリの開発を主軸に置きつつ、技術書への寄稿や、ゲーム開発のコンサルティングなどを手がけています。
# Load the MNIST digit recognition dataset into R | |
# http://yann.lecun.com/exdb/mnist/ | |
# assume you have all 4 files and gunzip'd them | |
# creates train$n, train$x, train$y and test$n, test$x, test$y | |
# e.g. train$x is a 60000 x 784 matrix, each row is one digit (28x28) | |
# call: show_digit(train$x[5,]) to see a digit. | |
# brendan o'connor - gist.github.com/39760 - anyall.org | |
load_mnist <- function() { | |
load_image_file <- function(filename) { |
from sklearn.datasets import load_iris | |
from sklearn.ensemble import RandomForestClassifier | |
import pandas as pd | |
import numpy as np | |
iris = load_iris() | |
df = pd.DataFrame(iris.data, columns=iris.feature_names) | |
df['is_train'] = np.random.uniform(0, 1, len(df)) <= .75 | |
df['species'] = pd.Factor(iris.target, iris.target_names) | |
df.head() |
library(dplyr) | |
library(ggplot2) | |
library(reshape2) | |
train <- read.csv("train.csv") | |
#test <- read.csv("test_v2.csv") | |
az <- train %.% | |
filter(record_type==1) %.% | |
select(A:G) |
N <- 15 | |
M <- 12 | |
K <- 3 | |
Wconc <- 100 | |
Hconc <- 5 | |
Winit <- structure(c(.056,.111,.056,.111,.056,.111,.056,.111,.056,.111,.056,.111,.111,.056,.111,.056,.111,.056,.111,.056,.111,.056,.111,.056,.063,.063,.125,.063,.063,.125,.063,.063,.125,.063,.063,.125 | |
), .Dim=c(12,3)) | |
X <- structure(c(.032,.032,.091,.032,.157,.264,.157,.139,.486,.257,.709,.934,.036,.036,.08,.036,.255,.192,.255,.1,.638,.171,1.228,.62,.039,.039,.226,.039,.119,.521,.119,.128,.809,.227,.475,1.537,.047,.047,.212,.047,.113,.589,.113,.242,.717,.458,.407,2.002,.02,.02,.058,.02,.07,.189,.07,.107,.251,.203,.293,.705,.033,.033,.062,.033,.128,.268,.128,.208,.325,.403,.549,1.142,.039,.039,.245,.039,.144,.516,.144,.081,.923,.128,.609,1.39,.05,.05,.189,.05,.326,.383,.326,.091,1.077,.136,1.55,1.024,.039,.039,.245,.039,.106,.548,.106,.112,.847,.194,.407,1.565,.023,.023,.134,.023,.072,.301,.072,.065,.486,.112,.291,.862,.04,.04,.145,.04,.205,.352,.205,.131,.726,.233,.938,1.107,.028,.028,.173,.028,.076,.397,.076,.093,.593,.164,.287,1.163,.028,.028,.058,.028,.14,.1 |
import numpy as np | |
import tensorflow as tf | |
# Newton's optimization method for multivariate function in tensorflow | |
def cons(x): | |
return tf.constant(x, dtype=tf.float32) | |
def compute_hessian(fn, vars): | |
mat = [] |