{"blog_title":"\u3089\u3093\u3060\u3080\u306a\u8a18\u61b6","width":"100%","author_name":"derwind","provider_url":"https://hatena.blog","type":"rich","blog_url":"https://randommemory.hatenablog.com/","categories":["machine_learning"],"image_url":null,"height":"190","url":"https://randommemory.hatenablog.com/entry/2021/12/05/160808","title":"einsum (2)","author_url":"https://blog.hatena.ne.jp/derwind/","published":"2021-12-05 16:08:08","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Frandommemory.hatenablog.com%2Fentry%2F2021%2F12%2F05%2F160808\" title=\"einsum (2) - \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>","provider_name":"Hatena Blog","version":"1.0","description":">>> a = np.arange(1,5).reshape(2,2) >>> a array([[1, 2], [3, 4]]) >>> b = np.arange(-5,-1).reshape(2,2) >>> b array([[-5, -4], [-3, -2]]) \u3092\u4f7f\u3063\u305f\u3059\u3053\u3076\u308b\u5206\u304b\u308a\u306b\u304f\u3044\u6319\u52d5\u3092\u898b\u3066\u307f\u3088\u3046\u3002 >>> np.einsum('ij,ij->ij', a, b) array([[-5, -8], [-9, -8]]) >>> np.einsum('ij,ij->ji', a, b) array([[-5, -9], [-8, -8]]) \u3092\u8003\u3048\u3066\u307f\u305f\u3044\u3002\u6700\u521d\u306e\u4f8b\u306f\u3044\u308f\u3086\u2026"}