PyTorch torch.digamma 関数
torch.digammaこれは、PyTorch で要素ごとに psi 関数(対数導関数)を計算するための関数です。
関数定義
torch.digamma(input, *, out=None)
使用例
実例
import torch
# psi 関数の計算例
x = torch.tensor([1.0, 2.0, 3.0, 4.0], dtype=torch.float32)
result = torch.digamma(x)
print(result) # tensor([-0.5772, 0.4228, 1.2561, 2.0312])
# psi 関数の計算例
x = torch.tensor([1.0, 2.0, 3.0, 4.0], dtype=torch.float32)
result = torch.digamma(x)
print(result) # tensor([-0.5772, 0.4228, 1.2561, 2.0312])
その他の拡張
Pytorch torch リファレンスマニュアル