Make:08

読んだ

ProductName Make: Technology on Your Time Volume 08

オライリージャパン / ¥ 1,575 ()
在庫あり。

  • はてなって1U自作なのか
  • Garduino面白そう
  • Auduinoも面白そう

今日の畑(091101)

3週間ぶりの畑。こんなに間を空けたのははじめて。

  • ジャガイモ枯れてた。秋撒きはだめなのかなぁ。それとも連作障害?
    • 春蒔きでチャレンジ。
  • ピーマン取れすぎ。20個以上もぎった
  • オクラでかすぎ。あまりにでかいのは固そうなので収穫から除外した。

小松菜はほうれん草と比べて育ちがはやい

1257061922

ほうれん草は雑草に埋もれているので、草取りを小一時間。夏の手強い雑草と違ってさくさくむしれるのでまぁラクチン。

1257061931

その後、近所のホームセンターに行ったら、そらまめとかサヤエンドウ、グリンピースなんかが売ってた。

ソラマメでも植えようかと思ったんだけど、石灰撒いたり肥料撒いたりする時間を考えると結構忙しいスケジュールかも。来年にむけて家庭菜園管理システムでもつくろうかな。

RBFネットワーク

Machine Learning 4章

ProductName Machine Learning: An Algorithmic Perspective (Chapman & Hall/Crc Machine Learning & Patrtern Recognition)
Stephen Marsland
Chapman & Hall / ¥ 6,459 ()
通常1~3週間以内に発送

  • k-meansで初期値決め
  • train
    • パーセプトロンの学習アルゴリズムと大体一緒

scipyにはB-splinesが用意されているのでそれを使ってみる

from pylab import *
from numpy import *
from scipy.signal import cspline1d, cspline1d_eval
x = arange(-3,10,0.05)
y = 2.5 * exp(-(x)**2/9) + 3.2 * exp(-(x-0.5)**2/4) + random.normal(0.0, 1.0, len(x))
spline = cspline1d(y,100)
xbar = arange(-5,15,0.1)
ybar = cspline1d_eval(spline, xbar, dx=x[1]-x[0], x0=x[0])
plot(x,y,'.')
plot(xbar,ybar)

b-splines

Validity of the model

引き続きThe Art of Modelingという章から。

ProductName Pharmacokinetic-Pharmacodynamic Modeling and Simulation
Peter Bonate
Springer / ¥ 8,475 ()
在庫あり。

Validity of the modelとは

  • Face-validity
  • Credibility
  • Internal validity
  • External validity
  • Pragmatic validity

からなる。

二番目のCredibilityはユーザーのモデルに対する信念みたいなもの。

みやさか

真澄の蔵だけど、柔らかくて甘みを感じる。

1256823882

アルコール度数12度ということもあってかすいすい吞める。

酒屋さんに燗つけても美味しいのとリクエストしたら薦められたので最初は燗つけてたんだけど、冷やのほうが美味くなってきてそのまま飲んでた。

あと、来週いわせさんの酒の会にいくことにした。楽しみ

Only a question can point the way forward.

モデルっていうのは仮説をドリブンして、本質に近づくために存在するのであって、正解率をあげるための単なる機械という認識は困るし、仮説ドリブンとか言うといて、その仮説がモチベーションをあげるための単なる虚言で、検証しないことを前提なのも困る。

Hello? / Jostein Gaarder

言葉の定義が揃ってないだけなのかもしれないけど(とか言っておこう)

Properties of useful model

いきなりThe Art of Modelingという章から入って、いいことたくさん書いてある。

ProductName Pharmacokinetic-Pharmacodynamic Modeling and Simulation
Peter Bonate
Springer / ¥ 8,475 ()
在庫あり。

有用なモデルの特性とは

  • Ability characterize the observed data and to include the most important features of the data
  • Makes accurate and precise predictions
  • Increases understanding of the system
  • The model is actually used
  • The model is completed on time
  • Logically consistent, plausible
  • Validated by empirical observations
  • Robust to small changes in the data
  • Appropriate level of precision and detail
  • As simple as possible
  • Judged on what it is intended to do
  • Has flexibility
  • Is effective as a communication tool
  • Serves many different purpose
  • May allow for extrapolation outside the data range

LeadOptimizationのプロジェクトにおいては

  • Ability characterize the observed data and to include the most important features of the data
  • Is effective as a communication tool

の二つが特に重要なんだろうなぁと思う。自分でモデリングできるのであれば、前者だけを重要視するかもしれない。

三文ゴシップ / 椎名林檎

落ち着いた?それとも薄まった?

ProductName 三文ゴシップ
椎名林檎
EMIミュージックジャパン / ¥ 3,059 (2009-06-24)
在庫あり。

危うさというか、アグレッシブというか攻撃的というか斜に構えてるっていうか、そういう鋭さ的なものはあんまないかも。

まぁそんな感じ。嫌いではないけどね。

Pythonで多層パーセプトロン

Machine Learning 3章

ProductName Machine Learning: An Algorithmic Perspective (Chapman & Hall/Crc Machine Learning & Patrtern Recognition)
Stephen Marsland
Chapman & Hall / ¥ 6,459 ()
通常1~3週間以内に発送

要するにbackwars phaseを実装すればいいんでしょ?的な。実際書いてみると逆に誤差を伝播している感がある。

# Code from Chapter 3 of Machine Learning: An Algorithmic Perspective
# by Stephen Marsland (http://seat.massey.ac.nz/personal/s.r.marsland/MLBook.html)

# You are free to use, change, or redistribute the code in any way you wish for
# non-commercial purposes, but please maintain the name of the original author.
# This code comes with no warranty of any kind.

# Stephen Marsland, 2008
# modifiled by kzfm 2009

from numpy import *

inputs = array([[0,0],[0,1],[1,0],[1,1]])
targets = array([[0],[1],[1],[0]])

ndata,nin   = shape(inputs)
nout        = shape(targets)[1]
nhidden     = 2
beta        = 1
momentum    = 0.9
eta         = 0.25
niterations = 10001

weights1 = (random.rand(nin+1,nhidden)-0.5) * 2/sqrt(nin)
weights2 = (random.rand(nhidden+1,nout)-0.5) * 2/sqrt(nhidden)

# train
inputs = concatenate((inputs,-ones((ndata,1))),axis=1)
change = range(ndata)

updatew1 = zeros((shape(weights1)))
updatew2 = zeros((shape(weights2)))

for n in range(niterations):

    hidden = concatenate((1.0/(1.0+exp(-beta * dot(inputs,weights1))), -ones((shape(inputs)[0],1))),axis=1)
    outputs = 1.0 / (1.0+exp(-beta * dot(hidden,weights2)))
    error = 0.5 * sum((targets-outputs)**2)

    if (mod(n,1000)==0): print "Iteration: ",n, " Error: ",error    

    deltao = (targets-outputs) * outputs * (1.0-outputs)            
    deltah = hidden * (1.0-hidden) * (dot(deltao,transpose(weights2)))

    updatew1 = eta*(dot(transpose(inputs),deltah[:,:-1])) + momentum*updatew1
    updatew2 = eta*(dot(transpose(hidden),deltao)) + momentum*updatew2

    weights1 += updatew1
    weights2 += updatew2

    random.shuffle(change)
    inputs = inputs[change,:]
    targets = targets[change,:]

ちなみに、創薬系でのニューラルネットは論文とかは多いけど、実務ではあんまり使われないと思う(特にケミストよりになればなるほど)。というのは、実務においてはゴールするためにはこういうロジックで合成すればよろしいみたいな指針を提示しないといけないが、ニューラルネットでつくったモデルだとそういう解釈がしづらい。

なんか物がたくさんあって、フィルタリングしたいという要求には答えられるけど、何をどういう指針に従って創るかみたいな、創造(製造)律速な問題には使いにくい。

じゃぁ神経系は創造的ではないのかというと、それはまた違うんじゃないかなぁと思ったりもする。モデル化があれなのかなぁとも思うのだけど、、、、

macbook届いた

新型はまるっこくなって、多少薄くなってた。

1256642149

skypeとfirefoxとpicasaだけ入れとけばいいのでU隊長(カジュアルユーザー)のための設定は楽。

1256642142

早速youtubeのピングーをせがむ娘。

追記

iPhoto使うからpicasaはいらんと言われた。