第2章準備
2.3.1. Scalars2.3.1 スカラー
Most everyday mathematics consists of manipulating numbers one at a time. Formally, we call these values scalars. For example, the temperature in Palo Alto is a balmy degrees Fahrenheit. If you wanted to convert the temperature to Celsius you would evaluate the expression , setting to . In this equation, the values , , and are constant scalars. The variables and in general represent unknown scalars.
英語のヒント
日常の数学のほとんどは、数を一つずつ操作することからなる。形式的には、こうした値をスカラーと呼ぶ。たとえば、パロアルトの気温は華氏度で、心地よい暖かさである。この気温を摂氏に変換したければ、をとして式を計算する。この方程式では、値、、は定数のスカラーである。変数とは一般に未知のスカラーを表す。
We denote scalars by ordinary lower-cased letters (e.g., , , and ) and the space of all (continuous) real-valued scalars by . For expedience, we will skip past rigorous definitions of spaces: just remember that the expression is a formal way to say that is a real-valued scalar. The symbol (pronounced “in”) denotes membership in a set. For example, indicates that and are variables that can only take values or .
英語のヒント
スカラーは普通の小文字(たとえば、、)で表し、(連続な)実数値のスカラー全体の空間をで表す。手っ取り早くするため、空間の厳密な定義は飛ばす。式は、が実数値のスカラーであることを形式的に言う書き方だ、とだけ覚えておけばよい。記号(「イン」と読む)は、集合への所属を表す。たとえばは、とが値かしかとれない変数であることを示す。
Scalars are implemented as tensors that contain only one element. Below, we assign two scalars and perform the familiar addition, multiplication, division, and exponentiation operations.
英語のヒント
スカラーは、要素を一つだけ含むテンソルとして実装される。下では、二つのスカラーを代入し、おなじみの加算、乗算、除算、累乗の演算を行う。
x = torch.tensor(3.0)
y = torch.tensor(2.0)
x + y, x * y, x / y, x**y(tensor(5.), tensor(6.), tensor(1.5000), tensor(9.))