{"type":"rich","blog_url":"https://minus9d.hatenablog.com/","provider_name":"Hatena Blog","author_name":"minus9d","title":"NumPy\u3067\u30d9\u30af\u30c8\u30eb\u306e\u9577\u3055\u30921\u306b\u6b63\u898f\u5316","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fminus9d.hatenablog.com%2Fentry%2F2022%2F03%2F28%2F224230\" title=\"NumPy\u3067\u30d9\u30af\u30c8\u30eb\u306e\u9577\u3055\u30921\u306b\u6b63\u898f\u5316 - minus9d&#39;s diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"minus9d's diary","description":"NumPy\u3067\u30d9\u30af\u30c8\u30eb\u306e\u9577\u3055\u30921\u306b\u6b63\u898f\u5316\u3059\u308b\u306b\u306f\u3001np.linalg.norm\u3092\u4f7f\u3044\u307e\u3059\u3002 \u30d9\u30af\u30c8\u30eb\u306e\u4f8b \u4f8b\u3048\u3070\u3001\u8981\u7d20\u65703\u306e\u30d9\u30af\u30c8\u30eb\u306e\u9577\u3055\uff08\u3088\u308a\u6b63\u78ba\u306b\u306f\u3001\u30e6\u30fc\u30af\u30ea\u30c3\u30c9\u8ddd\u96e2\u3002\u3059\u306a\u308f\u3061L2\u30ce\u30eb\u30e0\uff09\u30921\u306b\u6b63\u898f\u5316\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002 vec = np.array([3.0, 4.0, 5.0]) unit_vec = vec / np.linalg.norm(vec, ord=2) # ord\u306f\u7701\u7565\u53ef print(unit_vec) # [0.42426407 0.56568542 0.70710678] \u3068\u8868\u793a \u691c\u7b97\u3059\u308b\u3068 sqrt(0.42426407 ^ 2 + 0.56568542 ^ \u2026","published":"2022-03-28 22:42:30","image_url":null,"url":"https://minus9d.hatenablog.com/entry/2022/03/28/224230","height":"190","categories":["python"],"width":"100%","author_url":"https://blog.hatena.ne.jp/minus9d/","version":"1.0"}