PyTorch torch.atanh 関数
torch.atanhPyTorch において、要素ごとに逆双曲線正接(inverse hyperbolic tangent)を計算するための関数です。
関数定義
torch.atanh(input, out=None)
使用例
例
import torch
# テンソルを作成(値は -1 から 1 の間である必要があります)
x = torch.tensor([-0.5, -0.25, 0.0, 0.25, 0.5])
# 逆双曲線正接を計算
result = torch.atanh(x)
print(result)
# テンソルを作成(値は -1 から 1 の間である必要があります)
x = torch.tensor([-0.5, -0.25, 0.0, 0.25, 0.5])
# 逆双曲線正接を計算
result = torch.atanh(x)
print(result)
出力結果は次のとおりです:
tensor([-0.5493, -0.2554, 0.0000, 0.2554, 0.5493])
その他の拡張
Pytorch torch リファレンスマニュアル