{"html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Frandommemory.hatenablog.com%2Fentry%2F2021%2F12%2F05%2F155932\" title=\"einsum (1) - \u3089\u3093\u3060\u3080\u306a\u8a18\u61b6\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","published":"2021-12-05 15:59:32","height":"190","description":"\u3053\u3053\u3044\u3089\u3067 {numpy,tf,torch}.einsum \u306e\u52d5\u304d\u3092\u898b\u3066\u304a\u304d\u305f\u3044\u3002\u624b\u8efd\u3055\u306e\u89b3\u70b9\u3067 numpy \u3067\u898b\u308b\u3002 >>> a = np.arange(1,3) >>> a array([1, 2]) \u306e\u6642\u3001 >>> np.einsum('i,i', a,a) 5 \u3067\u3042\u308b\u3002\u3053\u308c\u306f\u3001-> \u3067\u306e\u884c\u304d\u5148\u304c\u306a\u3044\u306e\u3067\u3001\u7d50\u679c\u304c\u30b9\u30ab\u30e9\u306b\u306a\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3001\\begin{align*} c = a_i a_i \\end{align*}\u3064\u307e\u308a\\begin{align*} c = \\sum_i a_i a_i = 1 \\times 1 + 2 \\times 2 = 5 \\end{align*}\u3067\u30c9\u30c3\u30c8\u7a4d\u3068\u306a\u308b\u3002\u2026","author_name":"derwind","categories":["machine_learning"],"url":"https://randommemory.hatenablog.com/entry/2021/12/05/155932","blog_title":"\u3089\u3093\u3060\u3080\u306a\u8a18\u61b6","title":"einsum (1)","provider_url":"https://hatena.blog","blog_url":"https://randommemory.hatenablog.com/","image_url":null,"type":"rich","version":"1.0","provider_name":"Hatena Blog","author_url":"https://blog.hatena.ne.jp/derwind/","width":"100%"}