プリンキピア

第23章付録:深層学習のための道具

23.8.2. Functions23.8.2 関数

d2l.torch.add_to_class(Class)
Register functions as methods in created class.
英語のヒント
関数を、作成したクラスのメソッドとして登録する。
Defined in Section 3.2
英語のヒント
3.2節で定義
d2l.torch.bleu(pred_seq, label_seq, k)
Compute the BLEU.
英語のヒント
BLEUを計算する。
Defined in Section 10.7.6
英語のヒント
10.7.6節で定義
d2l.torch.check_len(a, n)
Check the length of a list.
英語のヒント
リストの長さを確かめる。
Defined in Section 9.5
英語のヒント
9.5節で定義
d2l.torch.check_shape(a, shape)
Check the shape of a tensor.
英語のヒント
テンソルの形を確かめる。
Defined in Section 9.5
英語のヒント
9.5節で定義
d2l.torch.corr2d(X, K)
Compute 2D cross-correlation.
英語のヒント
2次元の相互相関を計算する。
Defined in Section 7.2
英語のヒント
7.2節で定義
d2l.torch.cpu()
Get the CPU device.
英語のヒント
CPUのデバイスを得る。
Defined in Section 6.7
英語のヒント
6.7節で定義
d2l.torch.gpu(i=0)
Get a GPU device.
英語のヒント
GPUのデバイスを得る。
Defined in Section 6.7
英語のヒント
6.7節で定義
d2l.torch.init_cnn(module)
Initialize weights for CNNs.
英語のヒント
CNNの重みを初期化する。
Defined in Section 7.6
英語のヒント
7.6節で定義
d2l.torch.init_seq2seq(module)
Initialize weights for sequence-to-sequence learning.
英語のヒント
系列から系列への学習のための重みを初期化する。
Defined in Section 10.7
英語のヒント
10.7節で定義
d2l.torch.masked_softmax(X, valid_lens)
Perform softmax operation by masking elements on the last axis.
英語のヒント
最後の軸の要素をマスクしてソフトマックス演算を行う。
Defined in Section 11.3
英語のヒント
11.3節で定義
d2l.torch.num_gpus()
Get the number of available GPUs.
英語のヒント
使えるGPUの数を得る。
Defined in Section 6.7
英語のヒント
6.7節で定義
d2l.torch.plot(X, Y=None, xlabel=None, ylabel=None, legend=[], xlim=None, ylim=None, xscale='linear', yscale='linear', fmts=('-', 'm--', 'g-.', 'r:'), figsize=(3.5, 2.5), axes=None)
Plot data points.
英語のヒント
データ点をプロットする。
Defined in Section 2.4
英語のヒント
2.4節で定義
d2l.torch.set_axes(axes, xlabel, ylabel, xlim, ylim, xscale, yscale, legend)
Set the axes for matplotlib.
英語のヒント
matplotlibの軸を設定する。
Defined in Section 2.4
英語のヒント
2.4節で定義
d2l.torch.set_figsize(figsize=(3.5, 2.5))
Set the figure size for matplotlib.
英語のヒント
matplotlibの図の大きさを設定する。
Defined in Section 2.4
英語のヒント
2.4節で定義
d2l.torch.show_heatmaps(matrices, xlabel, ylabel, titles=None, figsize=(2.5, 2.5), cmap='Reds')
Show heatmaps of matrices.
英語のヒント
行列のヒートマップを表示する。
Defined in Section 11.1
英語のヒント
11.1節で定義
d2l.torch.show_list_len_pair_hist(legend, xlabel, ylabel, xlist, ylist)
Plot the histogram for list length pairs.
英語のヒント
リストの長さの組のヒストグラムをプロットする。
Defined in Section 10.5
英語のヒント
10.5節で定義
d2l.torch.try_all_gpus()
Return all available GPUs, or [cpu(),] if no GPU exists.
英語のヒント
使えるすべてのGPUを返す。GPUがなければ[cpu(),]を返す。
Defined in Section 6.7
英語のヒント
6.7節で定義
d2l.torch.try_gpu(i=0)
Return gpu(i) if exists, otherwise return cpu().
英語のヒント
gpu(i)があればそれを返し、なければcpu()を返す。
Defined in Section 6.7
英語のヒント
6.7節で定義
d2l.torch.use_svg_display()
Use the svg format to display a plot in Jupyter.
英語のヒント
Jupyterでプロットを表示するのにsvg形式を使う。
Defined in Section 2.4
英語のヒント
2.4節で定義