<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" 
  xmlns:content="http://purl.org/rss/1.0/modules/content/" 
  xmlns:dc="http://purl.org/dc/elements/1.1/" 
  xmlns:atom="http://www.w3.org/2005/Atom" 
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" 
  xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>PyTorch on 行李の底に収めたり[YuWd]</title>
    <link>https://yuiga.dev/blog/en/tags/pytorch/</link>
    <description>Recent content in PyTorch on 行李の底に収めたり[YuWd]</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <copyright>©2026, All Rights Reserved</copyright>
    <lastBuildDate>Thu, 18 Jan 2024 02:35:54 +0900</lastBuildDate>
    
        <atom:link href="https://yuiga.dev/blog/en/tags/pytorch/index.xml" rel="self" type="application/rss+xml" />
    

      
      <item>
        <title>【NeRF】動画から点群・メッシュ・任意視点動画を生成してみる</title>
        <link>https://yuiga.dev/blog/en/ja/posts/nerf%E5%8B%95%E7%94%BB%E3%81%8B%E3%82%89%E7%82%B9%E7%BE%A4%E3%83%A1%E3%83%83%E3%82%B7%E3%83%A5%E4%BB%BB%E6%84%8F%E8%A6%96%E7%82%B9%E5%8B%95%E7%94%BB%E3%82%92%E7%94%9F%E6%88%90%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B/</link>
        <pubDate>Thu, 18 Jan 2024 02:35:54 +0900</pubDate>
        
        <atom:modified>Thu, 18 Jan 2024 02:35:54 +0900</atom:modified>
        <guid>https://yuiga.dev/blog/en/ja/posts/nerf%E5%8B%95%E7%94%BB%E3%81%8B%E3%82%89%E7%82%B9%E7%BE%A4%E3%83%A1%E3%83%83%E3%82%B7%E3%83%A5%E4%BB%BB%E6%84%8F%E8%A6%96%E7%82%B9%E5%8B%95%E7%94%BB%E3%82%92%E7%94%9F%E6%88%90%E3%81%97%E3%81%A6%E3%81%BF%E3%82%8B/</guid>
        <description>NeRFを使えば，点群・メッシュ・任意視点動画が作れるのでやってみた 今回は愛飲するRedBullを被写体にしてみるヨ！ 任意視点動画 (GIF版) 任意視点動画 (動画版) Your browser does not support the video tag. 点群 NeRFとnerfstudioについて簡潔に説明 ボリュームレンダリング ある点 $x$と方向 $d$を入力として $(c,\sigma)$を出力</description>
        
        <dc:creator>YuWd (Yuiga Wada)</dc:creator>
        <media:content url="https://yuiga.dev/bloghttps://gyazo.com/a5b73842b81a0e44dd1a6551143567ba.gif" medium="image"><media:title type="html">featured image</media:title></media:content>
        
        
        
          
            
              <category>論文</category>
            
          
            
              <category>機械学習</category>
            
          
            
              <category>PyTorch</category>
            
          
            
              <category>CV</category>
            
          
        
        
        
          
            
          
        
      </item>
      
      <item>
        <title>【k8s・DDP】クラスタ上でのtorch.loadが遅い</title>
        <link>https://yuiga.dev/blog/en/ja/posts/k8sddp%E3%82%AF%E3%83%A9%E3%82%B9%E3%82%BF%E4%B8%8A%E3%81%A7%E3%81%AEtorch.load%E3%81%8C%E9%81%85%E3%81%84/</link>
        <pubDate>Sun, 17 Sep 2023 09:58:05 +0900</pubDate>
        
        <atom:modified>Sun, 17 Sep 2023 09:58:05 +0900</atom:modified>
        <guid>https://yuiga.dev/blog/en/ja/posts/k8sddp%E3%82%AF%E3%83%A9%E3%82%B9%E3%82%BF%E4%B8%8A%E3%81%A7%E3%81%AEtorch.load%E3%81%8C%E9%81%85%E3%81%84/</guid>
        <description>概要 巨大なembeddingをチャンクで外部に保存し，DDP(Distributed Data Parallel)を使った学習時に各GPUで読み込みたい そんなときtorch.load(path, map_location=f&amp;quot;cuda:{rank}&amp;quot;)にかかる時間の分散が大きい場合がある 前提: torch.loa</description>
        
        <dc:creator>YuWd (Yuiga Wada)</dc:creator>
        
        
        
        
          
            
              <category>k8s</category>
            
          
            
              <category>PyTorch</category>
            
          
            
              <category>post</category>
            
          
        
        
        
          
            
          
        
      </item>
      
      <item>
        <title>【PyTorch】「CUDA error: device-side assert triggered」 解決の手引き</title>
        <link>https://yuiga.dev/blog/en/ja/posts/pytorchcuda_error_device-side_assert_triggered_%E8%A7%A3%E6%B1%BA%E3%81%AE%E6%89%8B%E5%BC%95%E3%81%8D/</link>
        <pubDate>Sun, 23 Oct 2022 04:49:42 +0900</pubDate>
        
        <atom:modified>Sun, 23 Oct 2022 04:49:42 +0900</atom:modified>
        <guid>https://yuiga.dev/blog/en/ja/posts/pytorchcuda_error_device-side_assert_triggered_%E8%A7%A3%E6%B1%BA%E3%81%AE%E6%89%8B%E5%BC%95%E3%81%8D/</guid>
        <description>はじめに PyTorchにて, &amp;ldquo;RuntimeError: CUDA error: device-side assert triggered&amp;quot;というエラーに出くわすことがある ネットに転がってるモデルで発生すると特に厄介である (自分が作った沼ではないので&amp;hellip;) またMAEでのマスク処理のような, テクニカルな処理を行う場合などにも頻発 再現性が取れず, 出力されるエラー内容も二転三転. 一定</description>
        
        <dc:creator>YuWd (Yuiga Wada)</dc:creator>
        
        
        
        
          
            
              <category>python</category>
            
          
            
              <category>PyTorch</category>
            
          
            
              <category>post</category>
            
          
        
        
        
          
            
          
        
      </item>
      
      <item>
        <title>PyTorch 高速化</title>
        <link>https://yuiga.dev/blog/en/ja/posts/pytorch_%E9%AB%98%E9%80%9F%E5%8C%96/</link>
        <pubDate>Fri, 22 Apr 2022 19:39:45 +0900</pubDate>
        
        <atom:modified>Fri, 22 Apr 2022 19:39:45 +0900</atom:modified>
        <guid>https://yuiga.dev/blog/en/ja/posts/pytorch_%E9%AB%98%E9%80%9F%E5%8C%96/</guid>
        <description>https://qiita.com/sugulu_Ogawa_ISID/items/62f5f7adee083d96a587#31-ampautomatic-mixed-precision機能について</description>
        
        <dc:creator>YuWd (Yuiga Wada)</dc:creator>
        
        
        
        
          
            
              <category>PyTorch</category>
            
          
            
              <category>post</category>
            
          
        
        
        
          
            
          
        
      </item>
      
      <item>
        <title>Automatic Mixed Precision</title>
        <link>https://yuiga.dev/blog/en/ja/posts/automatic_mixed_precision/</link>
        <pubDate>Fri, 22 Apr 2022 18:00:31 +0900</pubDate>
        
        <atom:modified>Fri, 22 Apr 2022 18:00:31 +0900</atom:modified>
        <guid>https://yuiga.dev/blog/en/ja/posts/automatic_mixed_precision/</guid>
        <description>float16とfloat32を混ぜて(Mixed)計算することで, GPUのMEM使用率を抑えることができる 計算スピードも幾分速くなるらしい 略してamp https://qiita.com/Sosuke115/items/40265e6aaf2e414e2fea https://tawara.hatenablog.com/entry/2021/05/31/220936</description>
        
        <dc:creator>YuWd (Yuiga Wada)</dc:creator>
        
        
        
        
          
            
              <category>PyTorch</category>
            
          
            
              <category>post</category>
            
          
        
        
        
          
            
          
        
      </item>
      
      <item>
        <title>torch.view</title>
        <link>https://yuiga.dev/blog/en/ja/posts/torch.view/</link>
        <pubDate>Fri, 08 Apr 2022 21:15:20 +0900</pubDate>
        
        <atom:modified>Fri, 08 Apr 2022 21:15:20 +0900</atom:modified>
        <guid>https://yuiga.dev/blog/en/ja/posts/torch.view/</guid>
        <description>同じ順序でメモリ上に展開されてないとダメだから注意 1 2 3 4 &amp;gt;&amp;gt;&amp;gt; torch.t(x).view(-1, 2) Traceback (most recent call last): File &amp;#34;&amp;lt;stdin&amp;gt;&amp;#34;, line 1, in &amp;lt;module&amp;gt; RuntimeError: invalid argument 2: view size is not compatible with input tensor&amp;#39;s size and stride (at least one dimension spans across two contiguous subspaces). Call .contiguous() before .view(). at /Users/soumith/code/builder/wheel/pytorch-src/aten/src/TH/generic/THTensor.cpp:237 1 2 3 4 5 6 x = torch.Tensor([[[ 1., 5., 9.], [ 2., 6., 10.], [ 3., 7., 11.], [ 4., 8., 12.]]]) x = x.unsqueeze(0) print(x.transpose(-1,-2).view(1,-1,2)) ↑ これだとメモリ上に展開されてないからダメ 1 2 3 x = torch.Tensor([[1,2,3,4],[5,6,7,8],[9,10,11,12]]) x = x.unsqueeze(0).transpose(-1,-2) print(x.transpose(-1,-2).view(1,-1,2)) ↑こっちだとOK</description>
        
        <dc:creator>YuWd (Yuiga Wada)</dc:creator>
        
        
        
        
          
            
              <category>PyTorch</category>
            
          
            
              <category>post</category>
            
          
        
        
        
          
            
          
        
      </item>
      
      <item>
        <title>torchのテンソル積</title>
        <link>https://yuiga.dev/blog/en/ja/posts/torch%E3%81%AE%E3%83%86%E3%83%B3%E3%82%BD%E3%83%AB%E7%A9%8D/</link>
        <pubDate>Fri, 01 Apr 2022 23:38:39 +0900</pubDate>
        
        <atom:modified>Fri, 01 Apr 2022 23:38:39 +0900</atom:modified>
        <guid>https://yuiga.dev/blog/en/ja/posts/torch%E3%81%AE%E3%83%86%E3%83%B3%E3%82%BD%E3%83%AB%E7%A9%8D/</guid>
        <description>三次元 $\times $三次元の行列 １つ目をバッチサイズとして, バッチ単位で行列積 torch.bmm 4次元 $\times $3次元の行列 (j×1×n×m) と (kxm×p)の積は(j,k,n,p)となる バッチなど、行列以外の次元は、ブロードキャストされる。そのため、行列以外の次元はブロードキャストできるものでなければならない。例えば、tensor1が(j×1×n×</description>
        
        <dc:creator>YuWd (Yuiga Wada)</dc:creator>
        <media:content url="https://yuiga.dev/bloghttps://gyazo.com/e7244bb7be706ae0207cedea532c0a55.jpeg" medium="image"><media:title type="html">featured image</media:title></media:content>
        
        
        
          
            
              <category>PyTorch</category>
            
          
            
              <category>post</category>
            
          
        
        
        
          
            
          
        
      </item>
      
      <item>
        <title>torch.bmm</title>
        <link>https://yuiga.dev/blog/en/ja/posts/torch.bmm/</link>
        <pubDate>Fri, 01 Apr 2022 01:15:05 +0900</pubDate>
        
        <atom:modified>Fri, 01 Apr 2022 01:15:05 +0900</atom:modified>
        <guid>https://yuiga.dev/blog/en/ja/posts/torch.bmm/</guid>
        <description>バッチサイズ単位で行列積 @も同様 https://pytorch.org/docs/stable/generated/torch.bmm.html#torch.bmm</description>
        
        <dc:creator>YuWd (Yuiga Wada)</dc:creator>
        
        
        
        
          
            
              <category>PyTorch</category>
            
          
            
              <category>post</category>
            
          
        
        
        
          
            
          
        
      </item>
      
      <item>
        <title>PyTorchとメモリ</title>
        <link>https://yuiga.dev/blog/en/ja/posts/pytorch%E3%81%A8%E3%83%A1%E3%83%A2%E3%83%AA/</link>
        <pubDate>Tue, 29 Mar 2022 17:30:48 +0900</pubDate>
        
        <atom:modified>Tue, 29 Mar 2022 17:30:48 +0900</atom:modified>
        <guid>https://yuiga.dev/blog/en/ja/posts/pytorch%E3%81%A8%E3%83%A1%E3%83%A2%E3%83%AA/</guid>
        <description>必要なメモリ量 必要メモリ量(byte) = (ニューロンの数 × Batch Size ＋ パラメータ数) × 2 (data &amp;amp; grad) × 4(byte) https://nori-life-log.com/nnの学習で必要なgpuメモリを算出する 重みを固定(freeze) 1 2 3 # freeze all layers for param in model.parameters(): param.requires_grad = False</description>
        
        <dc:creator>YuWd (Yuiga Wada)</dc:creator>
        
        
        
        
          
            
              <category>PyTorch</category>
            
          
            
              <category>post</category>
            
          
        
        
        
          
            
          
        
      </item>
      
      <item>
        <title>einsum</title>
        <link>https://yuiga.dev/blog/en/ja/posts/einsum/</link>
        <pubDate>Fri, 18 Mar 2022 18:38:53 +0900</pubDate>
        
        <atom:modified>Fri, 18 Mar 2022 18:38:53 +0900</atom:modified>
        <guid>https://yuiga.dev/blog/en/ja/posts/einsum/</guid>
        <description>アインシュタインの縮約記法 テンソル積を書くと大量の $\Sigma$が出てきてうざい なので, $\Sigma$を省略しよう, というのが事の始まり $\sum_{j} a_{i,j}b_{j,k}$ なら ij,jk → ik プログラム的に考えれば, 単純にfor を外しただけ 例えば ドット積 z[i,j](https://scrapbox.io/yuwd/i%2Cj) += x[i,j](https://scrapbox.io/yuwd/i%2Cj) * y[i,j](https://scrapbox.io/yuwd/i%2Cj) np.einsum(&amp;quot;ij,ij-&amp;gt;ij&amp;quot;, x, y) 内積 z[j,k](https://scrapbox.io/yuwd/j%2Ck) += x[j,i](https://scrapbox.io/yuwd/j%2Ci) * y[i,k](https://scrapbox.io/yuwd/i%2Ck) np.einsum(&amp;quot;ji,ik-&amp;gt;jk&amp;quot;, x, y) 軸の入れ替えなどでも使える y = torch.einsum(&#39;nchw-&amp;gt;nhwc&#39;, y).detach().cpu() 実際は遅いからやめたほうが良さそう</description>
        
        <dc:creator>YuWd (Yuiga Wada)</dc:creator>
        
        
        
        
          
            
              <category>PyTorch</category>
            
          
            
              <category>post</category>
            
          
        
        
        
          
            
          
        
      </item>
      
      <item>
        <title>world_size</title>
        <link>https://yuiga.dev/blog/en/ja/posts/world_size/</link>
        <pubDate>Fri, 18 Mar 2022 17:07:28 +0900</pubDate>
        
        <atom:modified>Fri, 18 Mar 2022 17:07:28 +0900</atom:modified>
        <guid>https://yuiga.dev/blog/en/ja/posts/world_size/</guid>
        <description>world_size プロセス数 rank どのプロセスなのかを指定</description>
        
        <dc:creator>YuWd (Yuiga Wada)</dc:creator>
        
        
        
        
          
            
              <category>PyTorch</category>
            
          
            
              <category>post</category>
            
          
        
        
        
          
            
          
        
      </item>
      
      <item>
        <title>重みの初期化</title>
        <link>https://yuiga.dev/blog/en/ja/posts/%E9%87%8D%E3%81%BF%E3%81%AE%E5%88%9D%E6%9C%9F%E5%8C%96/</link>
        <pubDate>Sat, 12 Mar 2022 23:55:53 +0900</pubDate>
        
        <atom:modified>Sat, 12 Mar 2022 23:55:53 +0900</atom:modified>
        <guid>https://yuiga.dev/blog/en/ja/posts/%E9%87%8D%E3%81%BF%E3%81%AE%E5%88%9D%E6%9C%9F%E5%8C%96/</guid>
        <description>nn.init.hogehoge() で初期化できる 例 nn.init.xavier_uniform_(ln.weight) # Xavierの初期値 PyTorchの場合, デフォルトはHe</description>
        
        <dc:creator>YuWd (Yuiga Wada)</dc:creator>
        
        
        
        
          
            
              <category>機械学習</category>
            
          
            
              <category>PyTorch</category>
            
          
            
              <category>post</category>
            
          
        
        
        
          
            
          
        
      </item>
      
      <item>
        <title>RuntimeError: reciprocal_cuda not implemented for ComplexHalf</title>
        <link>https://yuiga.dev/blog/en/ja/posts/runtimeerror_reciprocal_cuda_not_implemented_for_complexhalf/</link>
        <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
        
        
        <guid>https://yuiga.dev/blog/en/ja/posts/runtimeerror_reciprocal_cuda_not_implemented_for_complexhalf/</guid>
        <description>1 C = C * (1. - dtA/2).reciprocal() * dt.unsqueeze(-1) # or * dtA / A ComplexHalf = torch.complex32のこと ComplexHalfにはreciprocal_cudaが実装されていないらしい 逆数を求める際の精度の問題？ AMPやfp16で計算しようとすると，本来64bitのcomplexで計算されるはずの項が32bitになって，逆数が計算できなくなる</description>
        
        <dc:creator>YuWd (Yuiga Wada)</dc:creator>
        
        
        
        
          
            
              <category>PyTorch</category>
            
          
            
              <category>Computer</category>
            
          
            
              <category>post</category>
            
          
        
        
        
          
            
          
        
      </item>
      

    
  </channel>
</rss>
