*概要 [#h4338afc]
-行列演算フレームワーク
--自動微分したり結構うれしい

*微分 [#pe62eb2a]
-初期化をしないと勾配の値が格納されている配列に加算されていくらしく、「勾配計算の前には初期化」と覚えておきましょう。

 x = chainer.Variable(np.array([[1, 2, 3], [4, 5, 6]], dtype=np.float32))
 y = x**2 - 2*x + 1
 y.grad = np.ones((2, 3), dtype=np.float32)
 y.backward()
 x.grad
 #out: array([[  0.,   2.,   4.], [  6.,   8.,  10.]], dtype=float32)

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS