<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>snowman_88888</author_name>
  <author_url>https://blog.hatena.ne.jp/snowman_88888/</author_url>
  <blog_title>Seitaro Shinagawaの雑記帳</blog_title>
  <blog_url>https://snowman-88888.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>はじめに chainerでforwardの計算をするときに行列の対角成分をとりたい時があったが、これを計算するfunctionsが現行のchainer(v1.19.0)に確認できなかった。 ちなみにTensorflowだとdiag_part()がこれに相当する。 http://devdocs.io/tensorflow~python/math_ops#diag_part Theanoだとdiagonal()という関数がある。がこれは成分でなく対角成分のみでつくった対角行列を返す？(試してない) github.com やりたい処理をnumpyで表現すると、具体的には以下のようになる。 &gt;&gt;&gt; i…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsnowman-88888.hatenablog.com%2Fentry%2F2017%2F01%2F08%2F050625&quot; title=&quot;chainerで正方行列の対角成分を抜き出す - Seitaro Shinagawaの雑記帳&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-01-08 05:06:25</published>
  <title>chainerで正方行列の対角成分を抜き出す</title>
  <type>rich</type>
  <url>https://snowman-88888.hatenablog.com/entry/2017/01/08/050625</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
