chunk_id large_stringlengths 36 36 | doc_type large_stringclasses 2
values | category large_stringclasses 17
values | document large_stringclasses 50
values | version_raw large_stringclasses 590
values | chunk_index int64 0 262 | text large_stringlengths 11 5.69k | file_path large_stringclasses 882
values |
|---|---|---|---|---|---|---|---|
499c0e60-dedd-57fe-bf4c-6cbfc7c59eb9 | docs | pytorch | pytorch_conv2d | 22 | 5 | * **kernel\_size** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)") *or* [*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")) – Size of the convolving kernel
* **stride** ([*int*](https://docs.python.org/3/library/functions.html#int "(in... | large_dataset/raw/docs/pytorch/conv2d/conv2d_22.md |
98a91697-bff4-5147-a67e-1bb330b2f5f1 | docs | pytorch | pytorch_conv2d | 22 | 6 | `'replicate'` or `'circular'`. Default: `'zeros'`
* **dilation** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)") *or* [*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")*,* *optional*) – Spacing between kernel elements. Default: 1
... | large_dataset/raw/docs/pytorch/conv2d/conv2d_22.md |
8c056908-f3b0-5d27-989b-8c4a7c44711d | docs | pytorch | pytorch_conv2d | 22 | 7 | * Output: (N,Cout,Hout,Wout)(N, C\_{out}, H\_{out}, W\_{out})(N,Cout,Hout,Wout) or (Cout,Hout,Wout)(C\_{out}, H\_{out}, W\_{out})(Cout,Hout,Wout), where
Hout=⌊Hin+2×padding[0]−dilation[0]×(kernel\_size[0]−1)−1stride[0]+1⌋H\_{out} = \left\lfloor\frac{H\_{in} + 2 \times \text{padding}[0] - \text{... | large_dataset/raw/docs/pytorch/conv2d/conv2d_22.md |
4c02e06b-fe83-5d08-8165-957a48598fe5 | docs | pytorch | pytorch_conv2d | 22 | 8 | (out\_channels,in\_channelsgroups,(\text{out\\_channels}, \frac{\text{in\\_channels}}{\text{groups}},(out\_channels,groupsin\_channels,
kernel\_size[0],kernel\_size[1])\text{kernel\\_size[0]}, \text{kernel\\_size[1]})kernel\_size[0],kernel\_size[1]).
The values of these weights are sample... | large_dataset/raw/docs/pytorch/conv2d/conv2d_22.md |
081ee27a-5a65-5f4d-ac73-741a0bf53f4e | docs | pytorch | pytorch_conv2d | 22 | 9 | >>> # With square kernels and equal stride
>>> m = nn.Conv2d(16, 33, 3, stride=2)
>>> # non-square kernels and unequal stride and with padding
>>> m = nn.Conv2d(16, 33, (3, 5), stride=(2, 1), padding=(4, 2))
>>> # non-square kernels and unequal stride and with padding and dilation
>>> m = nn.Con... | large_dataset/raw/docs/pytorch/conv2d/conv2d_22.md |
8801ca1e-c617-5c12-ac8d-727cde51d3ac | docs | pytorch | pytorch_conv2d | 23 | 0 | # Conv2d¶
Source: https://docs.pytorch.org/docs/2.3/generated/torch.nn.Conv2d.html
Version: 2.3
*class* torch.nn.Conv2d(*in\_channels*, *out\_channels*, *kernel\_size*, *stride=1*, *padding=0*, *dilation=1*, *groups=1*, *bias=True*, *padding\_mode='zeros'*, *device=None*, *dtype=None*)[[source]](../_modules/torch/nn/... | large_dataset/raw/docs/pytorch/conv2d/conv2d_23.md |
4c1e10c6-3abe-5f5f-a23c-583514ab8c2f | docs | pytorch | pytorch_conv2d | 23 | 1 | out(Ni,Coutj)=bias(Coutj)+k=0∑Cin−1weight(Coutj,k)⋆input(Ni,k)
where ⋆\star⋆ is the valid 2D [cross-correlation](https://en.wikipedia.org/wiki/Cross-correlation) operator,
NNN is a batch size, CCC denotes a number of channels,
HHH is a height of input planes in pixels, and WWW is
width in... | large_dataset/raw/docs/pytorch/conv2d/conv2d_23.md |
9ca52461-ee83-51b6-a30e-737478693bcb | docs | pytorch | pytorch_conv2d | 23 | 2 | known as the à trous algorithm. It is harder to describe, but this [link](https://github.com/vdumoulin/conv_arithmetic/blob/master/README.md)
has a nice visualization of what `dilation` does.
* `groups` controls the connections between inputs and outputs.
`in_channels` and `out_channels` must both... | large_dataset/raw/docs/pytorch/conv2d/conv2d_23.md |
719a2f8f-ec4b-55d9-bcba-573c7fc7df30 | docs | pytorch | pytorch_conv2d | 23 | 3 | > * a single `int` – in which case the same value is used for the height and width dimension
> * a `tuple` of two ints – in which case, the first int is used for the height dimension,
> and the second int for the width dimension
Note
When groups == in\_channels and out\_channels == K \* in\_chan... | large_dataset/raw/docs/pytorch/conv2d/conv2d_23.md |
0458f54c-b2d5-5d0d-b71e-deb50a51c63d | docs | pytorch | pytorch_conv2d | 23 | 4 | In some circumstances when given tensors on a CUDA device and using CuDNN, this operator may select a nondeterministic algorithm to increase performance. If this is undesirable, you can try to make the operation deterministic (potentially at a performance cost) by setting `torch.backends.cudnn.deterministic = True`... | large_dataset/raw/docs/pytorch/conv2d/conv2d_23.md |
644354c3-628b-5414-af37-98517b05dc34 | docs | pytorch | pytorch_conv2d | 23 | 5 | * **kernel\_size** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)") *or* [*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")) – Size of the convolving kernel
* **stride** ([*int*](https://docs.python.org/3/library/functions.html#int "(in... | large_dataset/raw/docs/pytorch/conv2d/conv2d_23.md |
d018eef0-762b-5ad7-931a-32a8a83cf22d | docs | pytorch | pytorch_conv2d | 23 | 6 | `'replicate'` or `'circular'`. Default: `'zeros'`
* **dilation** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)") *or* [*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")*,* *optional*) – Spacing between kernel elements. Default: 1
... | large_dataset/raw/docs/pytorch/conv2d/conv2d_23.md |
1c12a245-dafc-5af4-bc1f-ef7e457e8397 | docs | pytorch | pytorch_conv2d | 23 | 7 | * Output: (N,Cout,Hout,Wout)(N, C\_{out}, H\_{out}, W\_{out})(N,Cout,Hout,Wout) or (Cout,Hout,Wout)(C\_{out}, H\_{out}, W\_{out})(Cout,Hout,Wout), where
Hout=⌊Hin+2×padding[0]−dilation[0]×(kernel\_size[0]−1)−1stride[0]+1⌋H\_{out} = \left\lfloor\frac{H\_{in} + 2 \times \text{padding}[0] - \text{... | large_dataset/raw/docs/pytorch/conv2d/conv2d_23.md |
1c763cf0-1167-5507-91f6-60ded257e475 | docs | pytorch | pytorch_conv2d | 23 | 8 | (out\_channels,in\_channelsgroups,(\text{out\\_channels}, \frac{\text{in\\_channels}}{\text{groups}},(out\_channels,groupsin\_channels,
kernel\_size[0],kernel\_size[1])\text{kernel\\_size[0]}, \text{kernel\\_size[1]})kernel\_size[0],kernel\_size[1]).
The values of these weights are sample... | large_dataset/raw/docs/pytorch/conv2d/conv2d_23.md |
8e3033b4-b864-58b7-b4fb-6a86cc6c09b9 | docs | pytorch | pytorch_conv2d | 23 | 9 | >>> # With square kernels and equal stride
>>> m = nn.Conv2d(16, 33, 3, stride=2)
>>> # non-square kernels and unequal stride and with padding
>>> m = nn.Conv2d(16, 33, (3, 5), stride=(2, 1), padding=(4, 2))
>>> # non-square kernels and unequal stride and with padding and dilation
>>> m = nn.Con... | large_dataset/raw/docs/pytorch/conv2d/conv2d_23.md |
f1b8f6d2-6e45-58c2-b819-99a34cd23cf9 | docs | pytorch | pytorch_conv2d | 24 | 0 | # Conv2d¶
Source: https://docs.pytorch.org/docs/2.4/generated/torch.nn.Conv2d.html
Version: 2.4
*class* torch.nn.Conv2d(*in\_channels*, *out\_channels*, *kernel\_size*, *stride=1*, *padding=0*, *dilation=1*, *groups=1*, *bias=True*, *padding\_mode='zeros'*, *device=None*, *dtype=None*)[[source]](../_modules/torch/nn/... | large_dataset/raw/docs/pytorch/conv2d/conv2d_24.md |
f474c161-1e3b-5484-8554-873b4df51bc1 | docs | pytorch | pytorch_conv2d | 24 | 1 | out(Ni,Coutj)=bias(Coutj)+k=0∑Cin−1weight(Coutj,k)⋆input(Ni,k)
where ⋆\star⋆ is the valid 2D [cross-correlation](https://en.wikipedia.org/wiki/Cross-correlation) operator,
NNN is a batch size, CCC denotes a number of channels,
HHH is a height of input planes in pixels, and WWW is
width in... | large_dataset/raw/docs/pytorch/conv2d/conv2d_24.md |
d4658ee7-f423-55b2-a3d1-7e8f1271d5f4 | docs | pytorch | pytorch_conv2d | 24 | 2 | known as the u00e0 trous algorithm. It is harder to describe, but this [link](https://github.com/vdumoulin/conv_arithmetic/blob/master/README.md)
has a nice visualization of what `dilation` does.
* `groups` controls the connections between inputs and outputs.
`in_channels` and `out_channels` must ... | large_dataset/raw/docs/pytorch/conv2d/conv2d_24.md |
7047d5d3-d2dd-5955-bda7-4f692f4a9b78 | docs | pytorch | pytorch_conv2d | 24 | 3 | > * a single `int` – in which case the same value is used for the height and width dimension
> * a `tuple` of two ints – in which case, the first int is used for the height dimension,
> and the second int for the width dimension
Note
When groups == in\_channels and out\_channels == K \* in\_chan... | large_dataset/raw/docs/pytorch/conv2d/conv2d_24.md |
f7f40713-2a73-5af5-b60a-650f7d93fdec | docs | pytorch | pytorch_conv2d | 24 | 4 | In some circumstances when given tensors on a CUDA device and using CuDNN, this operator may select a nondeterministic algorithm to increase performance. If this is undesirable, you can try to make the operation deterministic (potentially at a performance cost) by setting `torch.backends.cudnn.deterministic = True`... | large_dataset/raw/docs/pytorch/conv2d/conv2d_24.md |
1fa74e16-6e39-5400-81ff-3b5fa0af89b3 | docs | pytorch | pytorch_conv2d | 24 | 5 | * **kernel\_size** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)") *or* [*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")) – Size of the convolving kernel
* **stride** ([*int*](https://docs.python.org/3/library/functions.html#int "(in... | large_dataset/raw/docs/pytorch/conv2d/conv2d_24.md |
929a9fca-1ef5-5a08-9895-100b3adf6963 | docs | pytorch | pytorch_conv2d | 24 | 6 | `'replicate'` or `'circular'`. Default: `'zeros'`
* **dilation** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)") *or* [*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")*,* *optional*) – Spacing between kernel elements. Default: 1
... | large_dataset/raw/docs/pytorch/conv2d/conv2d_24.md |
449aecd9-ab20-5234-ae9e-9d3c74fed82c | docs | pytorch | pytorch_conv2d | 24 | 7 | * Output: (N,Cout,Hout,Wout)(N, C\_{out}, H\_{out}, W\_{out})(N,Cout,Hout,Wout) or (Cout,Hout,Wout)(C\_{out}, H\_{out}, W\_{out})(Cout,Hout,Wout), where
Hout=⌊Hin+2×padding[0]−dilation[0]×(kernel\_size[0]−1)−1stride[0]+1⌋H\_{out} = \left\lfloor\frac{H\_{in} + 2 \times \text{padding}[0] - \text{... | large_dataset/raw/docs/pytorch/conv2d/conv2d_24.md |
1b5a0620-e210-53b3-b052-8da32637a6d1 | docs | pytorch | pytorch_conv2d | 24 | 8 | (out\_channels,in\_channelsgroups,(\text{out\\_channels}, \frac{\text{in\\_channels}}{\text{groups}},(out\_channels,groupsin\_channels,
kernel\_size[0],kernel\_size[1])\text{kernel\\_size[0]}, \text{kernel\\_size[1]})kernel\_size[0],kernel\_size[1]).
The values of these weights are sample... | large_dataset/raw/docs/pytorch/conv2d/conv2d_24.md |
0b2d7bb0-cc31-524f-bf1a-d978e2f0f55e | docs | pytorch | pytorch_conv2d | 24 | 9 | >>> # With square kernels and equal stride
>>> m = nn.Conv2d(16, 33, 3, stride=2)
>>> # non-square kernels and unequal stride and with padding
>>> m = nn.Conv2d(16, 33, (3, 5), stride=(2, 1), padding=(4, 2))
>>> # non-square kernels and unequal stride and with padding and dilation
>>> m = nn.Con... | large_dataset/raw/docs/pytorch/conv2d/conv2d_24.md |
3e9955b1-d7a9-5967-95ce-c2e67be4df07 | docs | pytorch | pytorch_conv2d | 25 | 0 | # Conv2d¶
Source: https://docs.pytorch.org/docs/2.5/generated/torch.nn.Conv2d.html
Version: 2.5
*class* torch.nn.Conv2d(*in\_channels*, *out\_channels*, *kernel\_size*, *stride=1*, *padding=0*, *dilation=1*, *groups=1*, *bias=True*, *padding\_mode='zeros'*, *device=None*, *dtype=None*)[[source]](../_modules/torch/nn/... | large_dataset/raw/docs/pytorch/conv2d/conv2d_25.md |
b3bafa99-2684-5406-9c24-e3ffb5c73b13 | docs | pytorch | pytorch_conv2d | 25 | 1 | out(Ni,Coutj)=bias(Coutj)+k=0∑Cin−1weight(Coutj,k)⋆input(Ni,k)
where ⋆\star⋆ is the valid 2D [cross-correlation](https://en.wikipedia.org/wiki/Cross-correlation) operator,
NNN is a batch size, CCC denotes a number of channels,
HHH is a height of input planes in pixels, and WWW is
width in... | large_dataset/raw/docs/pytorch/conv2d/conv2d_25.md |
80242941-f9b3-5127-866b-47904b7ca23a | docs | pytorch | pytorch_conv2d | 25 | 2 | known as the à trous algorithm. It is harder to describe, but this [link](https://github.com/vdumoulin/conv_arithmetic/blob/master/README.md)
has a nice visualization of what `dilation` does.
* `groups` controls the connections between inputs and outputs.
`in_channels` and `out_channels` must both... | large_dataset/raw/docs/pytorch/conv2d/conv2d_25.md |
178b808c-9fec-5ea3-bdd5-681803325eb4 | docs | pytorch | pytorch_conv2d | 25 | 3 | > * a single `int` – in which case the same value is used for the height and width dimension
> * a `tuple` of two ints – in which case, the first int is used for the height dimension,
> and the second int for the width dimension
Note
When groups == in\_channels and out\_channels == K \* in\_chan... | large_dataset/raw/docs/pytorch/conv2d/conv2d_25.md |
be62c8c1-84f6-5161-a261-dd7caf78b8e3 | docs | pytorch | pytorch_conv2d | 25 | 4 | In some circumstances when given tensors on a CUDA device and using CuDNN, this operator may select a nondeterministic algorithm to increase performance. If this is undesirable, you can try to make the operation deterministic (potentially at a performance cost) by setting `torch.backends.cudnn.deterministic = True`... | large_dataset/raw/docs/pytorch/conv2d/conv2d_25.md |
9de8f7ef-25c7-5669-8e2b-19f64fce0755 | docs | pytorch | pytorch_conv2d | 25 | 5 | * **kernel\_size** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *or* [*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)")) – Size of the convolving kernel
* **stride** ([*int*](https://docs.python.org/3/library/functions.html#int "(in... | large_dataset/raw/docs/pytorch/conv2d/conv2d_25.md |
147077c4-a6ea-530a-b5b6-788f0341ee65 | docs | pytorch | pytorch_conv2d | 25 | 6 | * **dilation** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *or* [*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)")*,* *optional*) – Spacing between kernel elements. Default: 1
* **groups** ([*int*](https://docs.python.org/3/library... | large_dataset/raw/docs/pytorch/conv2d/conv2d_25.md |
05063337-a81b-54b8-a4eb-0109f14f87d7 | docs | pytorch | pytorch_conv2d | 25 | 7 | : * Input: (N,Cin,Hin,Win)(N, C\_{in}, H\_{in}, W\_{in})(N,Cin,Hin,Win) or (Cin,Hin,Win)(C\_{in}, H\_{in}, W\_{in})(Cin,Hin,Win)
* Output: (N,Cout,Hout,Wout)(N, C\_{out}, H\_{out}, W\_{out})(N,Cout,Hout,Wout) or (Cout,Hout,Wout)(C\_{out}, H\_{out}, W\_{out})(Cout,Hout,Wout), where
H... | large_dataset/raw/docs/pytorch/conv2d/conv2d_25.md |
28711dfa-6c85-59dc-90ac-e7aaedaad11f | docs | pytorch | pytorch_conv2d | 25 | 8 | : * **weight** ([*Tensor*](../tensors.html#torch.Tensor "torch.Tensor")) – the learnable weights of the module of shape
(out\_channels,in\_channelsgroups,(\text{out\\_channels}, \frac{\text{in\\_channels}}{\text{groups}},(out\_channels,groupsin\_channels,
kernel\_size[0],kernel\_size[1])\text... | large_dataset/raw/docs/pytorch/conv2d/conv2d_25.md |
09667c10-d5bd-5f3e-b3f7-0215f2aa6334 | docs | pytorch | pytorch_conv2d | 25 | 9 | k=groupsCin∗∏i=01kernel\_size[i]k = \frac{groups}{C\_\text{in} \* \prod\_{i=0}^{1}\text{kernel\\_size}[i]}k=Cin∗∏i=01kernel\_size[i]groups
Examples
```None
>>> # With square kernels and equal stride
>>> m = nn.Conv2d(16, 33, 3, stride=2)
>>> # non-square kernels and unequal stride and... | large_dataset/raw/docs/pytorch/conv2d/conv2d_25.md |
ec47663b-b3cc-5c88-ac7a-e9c873a925e5 | docs | pytorch | pytorch_conv2d | 25 | 10 | Built with [Sphinx](http://sphinx-doc.org/) using a [theme](https://github.com/rtfd/sphinx_rtd_theme) provided by [Read the Docs](https://readthedocs.org).
| large_dataset/raw/docs/pytorch/conv2d/conv2d_25.md |
81a00482-f377-5be8-a333-202a5e0e07bb | docs | pytorch | pytorch_conv2d | 26 | 0 | # Conv2d¶
Source: https://docs.pytorch.org/docs/2.6/generated/torch.nn.Conv2d.html
Version: 2.6
*class* torch.nn.Conv2d(*in\_channels*, *out\_channels*, *kernel\_size*, *stride=1*, *padding=0*, *dilation=1*, *groups=1*, *bias=True*, *padding\_mode='zeros'*, *device=None*, *dtype=None*)[[source]](../_modules/torch/nn/... | large_dataset/raw/docs/pytorch/conv2d/conv2d_26.md |
233c971b-58b9-5230-8aa9-4d9132aef227 | docs | pytorch | pytorch_conv2d | 26 | 1 | \sum\_{k = 0}^{C\_{\text{in}} - 1} \text{weight}(C\_{\text{out}\_j}, k) \star \text{input}(N\_i, k)
out(Ni,Coutj)=bias(Coutj)+k=0∑Cin−1weight(Coutj,k)⋆input(Ni,k)
where ⋆\star⋆ is the valid 2D [cross-correlation](https://en.wikipedia.org/wiki/Cross-correlation) operator,
NNN is a batch size, ... | large_dataset/raw/docs/pytorch/conv2d/conv2d_26.md |
d0f3250a-143c-58f6-8165-6f4ae5d72212 | docs | pytorch | pytorch_conv2d | 26 | 2 | * `dilation` controls the spacing between the kernel points; also
known as the à trous algorithm. It is harder to describe, but this [link](https://github.com/vdumoulin/conv_arithmetic/blob/master/README.md)
has a nice visualization of what `dilation` does.
* `groups` controls the connections betwee... | large_dataset/raw/docs/pytorch/conv2d/conv2d_26.md |
4cbc2f7a-dddf-58a1-9ec8-69629a842363 | docs | pytorch | pytorch_conv2d | 26 | 3 | The parameters `kernel_size`, `stride`, `padding`, `dilation` can either be:
> * a single `int` – in which case the same value is used for the height and width dimension
> * a `tuple` of two ints – in which case, the first int is used for the height dimension,
> and the second int for the width dimen... | large_dataset/raw/docs/pytorch/conv2d/conv2d_26.md |
12162842-ff9c-5e18-8def-71d701593665 | docs | pytorch | pytorch_conv2d | 26 | 4 | In some circumstances when given tensors on a CUDA device and using CuDNN, this operator may select a nondeterministic algorithm to increase performance. If this is undesirable, you can try to make the operation deterministic (potentially at a performance cost) by setting `torch.backends.cudnn.deterministic = True`... | large_dataset/raw/docs/pytorch/conv2d/conv2d_26.md |
7bfefb0d-6cad-54c3-a8c0-9882467212d6 | docs | pytorch | pytorch_conv2d | 26 | 5 | * **kernel\_size** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *or* [*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)")) – Size of the convolving kernel
* **stride** ([*int*](https://docs.python.org/3/library/functions.html#int "(in... | large_dataset/raw/docs/pytorch/conv2d/conv2d_26.md |
0dd11791-5c76-5f5f-b62e-88b640409378 | docs | pytorch | pytorch_conv2d | 26 | 6 | * **dilation** ([*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") *or* [*tuple*](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)")*,* *optional*) – Spacing between kernel elements. Default: 1
* **groups** ([*int*](https://docs.python.org/3/library... | large_dataset/raw/docs/pytorch/conv2d/conv2d_26.md |
6558d3ef-ab19-5431-a750-3051a0ae99b9 | docs | pytorch | pytorch_conv2d | 26 | 7 | : * Input: (N,Cin,Hin,Win)(N, C\_{in}, H\_{in}, W\_{in})(N,Cin,Hin,Win) or (Cin,Hin,Win)(C\_{in}, H\_{in}, W\_{in})(Cin,Hin,Win)
* Output: (N,Cout,Hout,Wout)(N, C\_{out}, H\_{out}, W\_{out})(N,Cout,Hout,Wout) or (Cout,Hout,Wout)(C\_{out}, H\_{out}, W\_{out})(Cout,Hout,Wout), where
H... | large_dataset/raw/docs/pytorch/conv2d/conv2d_26.md |
20396967-47d3-5075-95f8-41fc001d6c69 | docs | pytorch | pytorch_conv2d | 26 | 8 | : * **weight** ([*Tensor*](../tensors.html#torch.Tensor "torch.Tensor")) – the learnable weights of the module of shape
(out\_channels,in\_channelsgroups,(\text{out\\_channels}, \frac{\text{in\\_channels}}{\text{groups}},(out\_channels,groupsin\_channels,
kernel\_size[0],kernel\_size[1])\text... | large_dataset/raw/docs/pytorch/conv2d/conv2d_26.md |
29b4b51b-e409-53ad-b6c3-89cba3383e79 | docs | pytorch | pytorch_conv2d | 26 | 9 | k=groupsCin∗∏i=01kernel\_size[i]k = \frac{groups}{C\_\text{in} \* \prod\_{i=0}^{1}\text{kernel\\_size}[i]}k=Cin∗∏i=01kernel\_size[i]groups
Examples
```None
>>> # With square kernels and equal stride
>>> m = nn.Conv2d(16, 33, 3, stride=2)
>>> # non-square kernels and unequal stride and... | large_dataset/raw/docs/pytorch/conv2d/conv2d_26.md |
6d089e01-18b7-59f4-a2a9-14eafa4086b2 | docs | pytorch | pytorch_conv2d | 26 | 10 | Built with [Sphinx](http://sphinx-doc.org/) using a [theme](https://github.com/rtfd/sphinx_rtd_theme) provided by [Read the Docs](https://readthedocs.org).
| large_dataset/raw/docs/pytorch/conv2d/conv2d_26.md |
baa919ca-dd6f-59a5-bc3a-7dd58ecb72c7 | docs | pytorch | pytorch_crossentropyloss | 20 | 0 | # CrossEntropyLoss¶
Source: https://docs.pytorch.org/docs/2.0/generated/torch.nn.CrossEntropyLoss.html
Version: 2.0
*class* torch.nn.CrossEntropyLoss(*weight=None*, *size\_average=None*, *ignore\_index=- 100*, *reduce=None*, *reduction='mean'*, *label\_smoothing=0.0*)[[source]](../_modules/torch/nn/modules/loss.html#... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_20.md |
f8e5ec45-2759-554b-b034-63b78a3b9d9e | docs | pytorch | pytorch_crossentropyloss | 20 | 1 | (minibatch,C)(minibatch, C)(minibatch,C) or (minibatch,C,d1,d2,...,dK)(minibatch, C, d\_1, d\_2, ..., d\_K)(minibatch,C,d1,d2,...,dK) with K≥1K \geq 1K≥1 for the
K-dimensional case. The last being useful for higher dimension inputs, such
as computing cross entropy loss per-pixel for 2D images.
The t... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_20.md |
580f4f14-daee-56c0-a2a6-a1df2f5978df | docs | pytorch | pytorch_crossentropyloss | 20 | 2 | ℓ(x,y)=L={l1,…,lN}⊤,ln=−wynlog∑c=1Cexp(xn,c)exp(xn,yn)⋅1{yn=ignore\_index}
where xxx is the input, yyy is the target, www is the weight,
CCC is the number of classes, and NNN spans the minibatch dimension as well as
d1,...,dkd\_1, ..., d\_kd1,...,dk for the K-dimensional case. If
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_20.md |
20333e59-760d-5d24-8f7b-92b6ee139301 | docs | pytorch | pytorch_crossentropyloss | 20 | 3 | [`NLLLoss`](torch.nn.NLLLoss.html#torch.nn.NLLLoss "torch.nn.NLLLoss").
* Probabilities for each class; useful when labels beyond a single class per minibatch item
are required, such as for blended labels, label smoothing, etc. The unreduced (i.e. with
`reduction` set to `'none'`) loss for this ca... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_20.md |
47081de4-5b7c-505e-a2e2-87010339f611 | docs | pytorch | pytorch_crossentropyloss | 20 | 4 | ℓ(x,y)={∑n=1NlnN,if reduction=‘mean’;∑n=1Nln,if reduction=‘sum’.\ell(x, y) = \begin{cases}
\frac{\sum\_{n=1}^N l\_n}{N}, &
\text{if reduction} = \text{`mean';}\\
\sum\_{n=1}^N l\_n, &
\text{if reduction} = \text{`sum'.}
\end{cases}
ℓ(x,y)={N∑n=1Nln,∑n=1Nln,if reduction=‘m... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_20.md |
97c690b6-7d8f-5970-a10d-eb4ddd0a6188 | docs | pytorch | pytorch_crossentropyloss | 20 | 5 | the losses are averaged over each loss element in the batch. Note that for
some losses, there are multiple elements per sample. If the field `size_average`
is set to `False`, the losses are instead summed for each minibatch. Ignored
when `reduce` is `False`. Default: `True`
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_20.md |
2c67752f-e809-5401-8ebb-19d85478385c | docs | pytorch | pytorch_crossentropyloss | 20 | 6 | on `size_average`. When `reduce` is `False`, returns a loss per
batch element instead and ignores `size_average`. Default: `True`
* **reduction** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.11)")*,* *optional*) – Specifies the reduction to apply to the output:... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_20.md |
ed9087b3-7363-5179-b3b1-f34ddc21f738 | docs | pytorch | pytorch_crossentropyloss | 20 | 7 | become a mixture of the original ground truth and a uniform distribution as described in
[Rethinking the Inception Architecture for Computer Vision](https://arxiv.org/abs/1512.00567). Default: 0.00.00.0.
Shape:
: * Input: Shape (C)(C)(C), (N,C)(N, C)(N,C) or (N,C,d1,d2,...,dK)(N, C, d\_1,... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_20.md |
4628ce80-9a0c-585a-b54f-e726bd96c6f0 | docs | pytorch | pytorch_crossentropyloss | 20 | 8 | in the case of K-dimensional loss, depending on the shape of the input. Otherwise, scalar.
where:
C=number of classesN=batch size\begin{aligned}
C ={} & \text{number of classes} \\
N ={} & \text{batch size} \\
\end{aligned}
C=N=number of classesbatch size
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_20.md |
7e074e96-bb31-5f40-8cdf-7e42412ff0dc | docs | pytorch | pytorch_crossentropyloss | 20 | 9 |
---
© Copyright 2023, PyTorch Contributors.
Built with [Sphinx](http://sphinx-doc.org/) using a [theme](https://github.com/rtfd/sphinx_rtd_theme) provided by [Read the Docs](https://readthedocs.org).
| large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_20.md |
305460f9-4924-5b22-aa4f-4c17fa487bb0 | docs | pytorch | pytorch_crossentropyloss | 21 | 0 | # CrossEntropyLoss¶
Source: https://docs.pytorch.org/docs/2.1/generated/torch.nn.CrossEntropyLoss.html
Version: 2.1
*class* torch.nn.CrossEntropyLoss(*weight=None*, *size\_average=None*, *ignore\_index=-100*, *reduce=None*, *reduction='mean'*, *label\_smoothing=0.0*)[[source]](../_modules/torch/nn/modules/loss.html#C... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_21.md |
db23bd04-cbac-58ba-a61d-023fd49f34f2 | docs | pytorch | pytorch_crossentropyloss | 21 | 1 | (minibatch,C)(minibatch, C)(minibatch,C) or (minibatch,C,d1,d2,...,dK)(minibatch, C, d\_1, d\_2, ..., d\_K)(minibatch,C,d1,d2,...,dK) with K≥1K \geq 1K≥1 for the
K-dimensional case. The last being useful for higher dimension inputs, such
as computing cross entropy loss per-pixel for 2D images.
The t... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_21.md |
46b5501f-d3ec-5489-b240-11129add836a | docs | pytorch | pytorch_crossentropyloss | 21 | 2 | ℓ(x,y)=L={l1,…,lN}⊤,ln=−wynlog∑c=1Cexp(xn,c)exp(xn,yn)⋅1{yn=ignore\_index}
where xxx is the input, yyy is the target, www is the weight,
CCC is the number of classes, and NNN spans the minibatch dimension as well as
d1,...,dkd\_1, ..., d\_kd1,...,dk for the K-dimensional case. If
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_21.md |
c925f328-67cd-508e-a3ca-405fd8f5e10f | docs | pytorch | pytorch_crossentropyloss | 21 | 3 | on an input, followed by [`NLLLoss`](torch.nn.NLLLoss.html#torch.nn.NLLLoss "torch.nn.NLLLoss").
* Probabilities for each class; useful when labels beyond a single class per minibatch item
are required, such as for blended labels, label smoothing, etc. The unreduced (i.e. with
`reduction` set to `... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_21.md |
e1af0098-2ac6-586a-8e8a-927374a2c918 | docs | pytorch | pytorch_crossentropyloss | 21 | 4 | ℓ(x,y)={∑n=1NlnN,if reduction=‘mean’;∑n=1Nln,if reduction=‘sum’.\ell(x, y) = \begin{cases}
\frac{\sum\_{n=1}^N l\_n}{N}, &
\text{if reduction} = \text{`mean';}\\
\sum\_{n=1}^N l\_n, &
\text{if reduction} = \text{`sum'.}
\end{cases}
ℓ(x,y)={N∑n=1Nln,∑n=1Nln,if reduction=‘m... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_21.md |
ed04a563-feab-5291-9dc4-678c883190fb | docs | pytorch | pytorch_crossentropyloss | 21 | 5 | the losses are averaged over each loss element in the batch. Note that for
some losses, there are multiple elements per sample. If the field `size_average`
is set to `False`, the losses are instead summed for each minibatch. Ignored
when `reduce` is `False`. Default: `True`
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_21.md |
2ce97655-c2a3-5457-9ff8-ab9c0c3ba001 | docs | pytorch | pytorch_crossentropyloss | 21 | 6 | on `size_average`. When `reduce` is `False`, returns a loss per
batch element instead and ignores `size_average`. Default: `True`
* **reduction** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")*,* *optional*) – Specifies the reduction to apply to the output:... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_21.md |
42935cc0-2468-57cf-9fef-3e09fef754af | docs | pytorch | pytorch_crossentropyloss | 21 | 7 | become a mixture of the original ground truth and a uniform distribution as described in
[Rethinking the Inception Architecture for Computer Vision](https://arxiv.org/abs/1512.00567). Default: 0.00.00.0.
Shape:
: * Input: Shape (C)(C)(C), (N,C)(N, C)(N,C) or (N,C,d1,d2,...,dK)(N, C, d\_1,... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_21.md |
3cd83dbb-1472-55ca-b71f-23d18b6fb447 | docs | pytorch | pytorch_crossentropyloss | 21 | 8 | in the case of K-dimensional loss, depending on the shape of the input. Otherwise, scalar.
where:
C=number of classesN=batch size\begin{aligned}
C ={} & \text{number of classes} \\
N ={} & \text{batch size} \\
\end{aligned}
C=N=number of classesbatch size
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_21.md |
5748f82e-4427-5064-959b-0e0bc96962fb | docs | pytorch | pytorch_crossentropyloss | 21 | 9 |
---
© Copyright 2023, PyTorch Contributors.
Built with [Sphinx](http://sphinx-doc.org/) using a [theme](https://github.com/rtfd/sphinx_rtd_theme) provided by [Read the Docs](https://readthedocs.org).
| large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_21.md |
c343050f-1592-580b-8604-08552de035eb | docs | pytorch | pytorch_crossentropyloss | 22 | 0 | # CrossEntropyLoss¶
Source: https://docs.pytorch.org/docs/2.2/generated/torch.nn.CrossEntropyLoss.html
Version: 2.2
*class* torch.nn.CrossEntropyLoss(*weight=None*, *size\_average=None*, *ignore\_index=-100*, *reduce=None*, *reduction='mean'*, *label\_smoothing=0.0*)[[source]](../_modules/torch/nn/modules/loss.html#C... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_22.md |
15c48855-2562-5a63-94fb-1bbaa73c22f1 | docs | pytorch | pytorch_crossentropyloss | 22 | 1 | (minibatch,C)(minibatch, C)(minibatch,C) or (minibatch,C,d1,d2,...,dK)(minibatch, C, d\_1, d\_2, ..., d\_K)(minibatch,C,d1,d2,...,dK) with K≥1K \geq 1K≥1 for the
K-dimensional case. The last being useful for higher dimension inputs, such
as computing cross entropy loss per-pixel for 2D images.
The t... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_22.md |
bc38e3f0-e1a9-52b9-b38f-b89f43eb6045 | docs | pytorch | pytorch_crossentropyloss | 22 | 2 | ℓ(x,y)=L={l1,…,lN}⊤,ln=−wynlog∑c=1Cexp(xn,c)exp(xn,yn)⋅1{yn=ignore\_index}
where xxx is the input, yyy is the target, www is the weight,
CCC is the number of classes, and NNN spans the minibatch dimension as well as
d1,...,dkd\_1, ..., d\_kd1,...,dk for the K-dimensional case. If
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_22.md |
5db5cfa5-113e-5b63-8772-0b100b313dc1 | docs | pytorch | pytorch_crossentropyloss | 22 | 3 | on an input, followed by [`NLLLoss`](torch.nn.NLLLoss.html#torch.nn.NLLLoss "torch.nn.NLLLoss").
* Probabilities for each class; useful when labels beyond a single class per minibatch item
are required, such as for blended labels, label smoothing, etc. The unreduced (i.e. with
`reduction` set to `... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_22.md |
da08a4eb-4915-577d-b211-639c3ce5a4a7 | docs | pytorch | pytorch_crossentropyloss | 22 | 4 | ℓ(x,y)={∑n=1NlnN,if reduction=‘mean’;∑n=1Nln,if reduction=‘sum’.\ell(x, y) = \begin{cases}
\frac{\sum\_{n=1}^N l\_n}{N}, &
\text{if reduction} = \text{`mean';}\\
\sum\_{n=1}^N l\_n, &
\text{if reduction} = \text{`sum'.}
\end{cases}
ℓ(x,y)={N∑n=1Nln,∑n=1Nln,if reduction=‘m... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_22.md |
f81a6606-b03d-504c-8eee-2a675d623143 | docs | pytorch | pytorch_crossentropyloss | 22 | 5 | the losses are averaged over each loss element in the batch. Note that for
some losses, there are multiple elements per sample. If the field `size_average`
is set to `False`, the losses are instead summed for each minibatch. Ignored
when `reduce` is `False`. Default: `True`
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_22.md |
1208383e-75a8-56ad-8381-e726e35e6363 | docs | pytorch | pytorch_crossentropyloss | 22 | 6 | on `size_average`. When `reduce` is `False`, returns a loss per
batch element instead and ignores `size_average`. Default: `True`
* **reduction** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")*,* *optional*) – Specifies the reduction to apply to the output:... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_22.md |
aeaadb8e-3251-5204-a76d-db9c4cd48c4f | docs | pytorch | pytorch_crossentropyloss | 22 | 7 | become a mixture of the original ground truth and a uniform distribution as described in
[Rethinking the Inception Architecture for Computer Vision](https://arxiv.org/abs/1512.00567). Default: 0.00.00.0.
Shape:
: * Input: Shape (C)(C)(C), (N,C)(N, C)(N,C) or (N,C,d1,d2,...,dK)(N, C, d\_1,... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_22.md |
d10ed80c-d021-53be-86cb-14b24893186a | docs | pytorch | pytorch_crossentropyloss | 22 | 8 | in the case of K-dimensional loss, depending on the shape of the input. Otherwise, scalar.
where:
C=number of classesN=batch size\begin{aligned}
C ={} & \text{number of classes} \\
N ={} & \text{batch size} \\
\end{aligned}
C=N=number of classesbatch size
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_22.md |
aebfcfb9-6d3c-5044-ac68-d088ab8dbe4d | docs | pytorch | pytorch_crossentropyloss | 22 | 9 |
---
© Copyright 2023, PyTorch Contributors.
Built with [Sphinx](http://sphinx-doc.org/) using a [theme](https://github.com/rtfd/sphinx_rtd_theme) provided by [Read the Docs](https://readthedocs.org).
| large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_22.md |
29a7ef31-3bdf-5279-86d0-ce0373706447 | docs | pytorch | pytorch_crossentropyloss | 23 | 0 | # CrossEntropyLoss¶
Source: https://docs.pytorch.org/docs/2.3/generated/torch.nn.CrossEntropyLoss.html
Version: 2.3
*class* torch.nn.CrossEntropyLoss(*weight=None*, *size\_average=None*, *ignore\_index=-100*, *reduce=None*, *reduction='mean'*, *label\_smoothing=0.0*)[[source]](../_modules/torch/nn/modules/loss.html#C... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_23.md |
abb11d93-24d8-5140-b149-0c99383da09c | docs | pytorch | pytorch_crossentropyloss | 23 | 1 | (minibatch,C)(minibatch, C)(minibatch,C) or (minibatch,C,d1,d2,...,dK)(minibatch, C, d\_1, d\_2, ..., d\_K)(minibatch,C,d1,d2,...,dK) with K≥1K \geq 1K≥1 for the
K-dimensional case. The last being useful for higher dimension inputs, such
as computing cross entropy loss per-pixel for 2D images.
The t... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_23.md |
ea3680af-b18f-53a4-9200-ebbf1090d91d | docs | pytorch | pytorch_crossentropyloss | 23 | 2 | ℓ(x,y)=L={l1,…,lN}⊤,ln=−wynlog∑c=1Cexp(xn,c)exp(xn,yn)⋅1{yn=ignore\_index}
where xxx is the input, yyy is the target, www is the weight,
CCC is the number of classes, and NNN spans the minibatch dimension as well as
d1,...,dkd\_1, ..., d\_kd1,...,dk for the K-dimensional case. If
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_23.md |
b2eb0c67-b0c5-5f61-b4d0-7170d679f435 | docs | pytorch | pytorch_crossentropyloss | 23 | 3 | on an input, followed by [`NLLLoss`](torch.nn.NLLLoss.html#torch.nn.NLLLoss "torch.nn.NLLLoss").
* Probabilities for each class; useful when labels beyond a single class per minibatch item
are required, such as for blended labels, label smoothing, etc. The unreduced (i.e. with
`reduction` set to `... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_23.md |
b945f4b5-7bf2-5051-8db9-b9bbb63eb31e | docs | pytorch | pytorch_crossentropyloss | 23 | 4 | ℓ(x,y)={∑n=1NlnN,if reduction=‘mean’;∑n=1Nln,if reduction=‘sum’.\ell(x, y) = \begin{cases}
\frac{\sum\_{n=1}^N l\_n}{N}, &
\text{if reduction} = \text{`mean';}\\
\sum\_{n=1}^N l\_n, &
\text{if reduction} = \text{`sum'.}
\end{cases}
ℓ(x,y)={N∑n=1Nln,∑n=1Nln,if reduction=‘m... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_23.md |
abf69e7b-4f16-52b9-b109-6c34a9ae5c55 | docs | pytorch | pytorch_crossentropyloss | 23 | 5 | the losses are averaged over each loss element in the batch. Note that for
some losses, there are multiple elements per sample. If the field `size_average`
is set to `False`, the losses are instead summed for each minibatch. Ignored
when `reduce` is `False`. Default: `True`
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_23.md |
e0846696-2807-5594-ab77-d8081bef0217 | docs | pytorch | pytorch_crossentropyloss | 23 | 6 | on `size_average`. When `reduce` is `False`, returns a loss per
batch element instead and ignores `size_average`. Default: `True`
* **reduction** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")*,* *optional*) – Specifies the reduction to apply to the output:... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_23.md |
f2d7ed90-cb32-5f58-b866-ae19e8a1727f | docs | pytorch | pytorch_crossentropyloss | 23 | 7 | become a mixture of the original ground truth and a uniform distribution as described in
[Rethinking the Inception Architecture for Computer Vision](https://arxiv.org/abs/1512.00567). Default: 0.00.00.0.
Shape:
: * Input: Shape (C)(C)(C), (N,C)(N, C)(N,C) or (N,C,d1,d2,...,dK)(N, C, d\_1,... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_23.md |
f4f784c8-e2a8-524b-b1d8-77e2c4148746 | docs | pytorch | pytorch_crossentropyloss | 23 | 8 | in the case of K-dimensional loss, depending on the shape of the input. Otherwise, scalar.
where:
C=number of classesN=batch size\begin{aligned}
C ={} & \text{number of classes} \\
N ={} & \text{batch size} \\
\end{aligned}
C=N=number of classesbatch size
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_23.md |
8ac5e368-30ad-5f3f-b37f-281b84c95dfa | docs | pytorch | pytorch_crossentropyloss | 23 | 9 |
---
© Copyright 2023, PyTorch Contributors.
Built with [Sphinx](http://sphinx-doc.org/) using a [theme](https://github.com/rtfd/sphinx_rtd_theme) provided by [Read the Docs](https://readthedocs.org).
| large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_23.md |
44f1be04-2436-5407-83de-33e801c463a3 | docs | pytorch | pytorch_crossentropyloss | 24 | 0 | # CrossEntropyLoss¶
Source: https://docs.pytorch.org/docs/2.4/generated/torch.nn.CrossEntropyLoss.html
Version: 2.4
*class* torch.nn.CrossEntropyLoss(*weight=None*, *size\_average=None*, *ignore\_index=-100*, *reduce=None*, *reduction='mean'*, *label\_smoothing=0.0*)[[source]](../_modules/torch/nn/modules/loss.html#C... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_24.md |
c98892d0-c3d4-5330-a508-dd03b0b86183 | docs | pytorch | pytorch_crossentropyloss | 24 | 1 | (minibatch,C)(minibatch, C)(minibatch,C) or (minibatch,C,d1,d2,...,dK)(minibatch, C, d\_1, d\_2, ..., d\_K)(minibatch,C,d1,d2,...,dK) with K≥1K \geq 1K≥1 for the
K-dimensional case. The last being useful for higher dimension inputs, such
as computing cross entropy loss per-pixel for 2D images.
The t... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_24.md |
94039f91-6c61-5f94-b8d2-9b969bbbc95a | docs | pytorch | pytorch_crossentropyloss | 24 | 2 | ℓ(x,y)=L={l1,…,lN}⊤,ln=−wynlog∑c=1Cexp(xn,c)exp(xn,yn)⋅1{yn=ignore\_index}
where xxx is the input, yyy is the target, www is the weight,
CCC is the number of classes, and NNN spans the minibatch dimension as well as
d1,...,dkd\_1, ..., d\_kd1,...,dk for the K-dimensional case. If
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_24.md |
95f90822-073a-5093-8524-998080847492 | docs | pytorch | pytorch_crossentropyloss | 24 | 3 | on an input, followed by [`NLLLoss`](torch.nn.NLLLoss.html#torch.nn.NLLLoss "torch.nn.NLLLoss").
* Probabilities for each class; useful when labels beyond a single class per minibatch item
are required, such as for blended labels, label smoothing, etc. The unreduced (i.e. with
`reduction` set to `... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_24.md |
179dadb6-b03f-5e74-8ae3-7459a83a030b | docs | pytorch | pytorch_crossentropyloss | 24 | 4 | ℓ(x,y)={∑n=1NlnN,if reduction=‘mean’;∑n=1Nln,if reduction=‘sum’.\ell(x, y) = \begin{cases}
\frac{\sum\_{n=1}^N l\_n}{N}, &
\text{if reduction} = \text{`mean';}\\
\sum\_{n=1}^N l\_n, &
\text{if reduction} = \text{`sum'.}
\end{cases}
ℓ(x,y)={N∑n=1Nln,∑n=1Nln,if reduction=‘m... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_24.md |
0dc244a0-b167-5c62-8bb1-a14f548f42d8 | docs | pytorch | pytorch_crossentropyloss | 24 | 5 | the losses are averaged over each loss element in the batch. Note that for
some losses, there are multiple elements per sample. If the field `size_average`
is set to `False`, the losses are instead summed for each minibatch. Ignored
when `reduce` is `False`. Default: `True`
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_24.md |
e8b8a6ca-ef7e-5036-80b8-4c2a51b7bd7c | docs | pytorch | pytorch_crossentropyloss | 24 | 6 | on `size_average`. When `reduce` is `False`, returns a loss per
batch element instead and ignores `size_average`. Default: `True`
* **reduction** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")*,* *optional*) – Specifies the reduction to apply to the output:... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_24.md |
5fef7c47-7920-5548-b1a8-8e7b4cb67376 | docs | pytorch | pytorch_crossentropyloss | 24 | 7 | become a mixture of the original ground truth and a uniform distribution as described in
[Rethinking the Inception Architecture for Computer Vision](https://arxiv.org/abs/1512.00567). Default: 0.00.00.0.
Shape:
: * Input: Shape (C)(C)(C), (N,C)(N, C)(N,C) or (N,C,d1,d2,...,dK)(N, C, d\_1,... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_24.md |
3c30ceff-0271-51bd-bf3c-1ffd5a86e396 | docs | pytorch | pytorch_crossentropyloss | 24 | 8 | in the case of K-dimensional loss, depending on the shape of the input. Otherwise, scalar.
where:
C=number of classesN=batch size\begin{aligned}
C ={} & \text{number of classes} \\
N ={} & \text{batch size} \\
\end{aligned}
C=N=number of classesbatch size
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_24.md |
b735ec5b-a998-5ff8-b6ab-a00c2f22ce43 | docs | pytorch | pytorch_crossentropyloss | 24 | 9 |
---
© Copyright 2023, PyTorch Contributors.
Built with [Sphinx](http://sphinx-doc.org/) using a [theme](https://github.com/rtfd/sphinx_rtd_theme) provided by [Read the Docs](https://readthedocs.org).
| large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_24.md |
eb67ee9f-c08a-585a-af49-107b4ff4d0fb | docs | pytorch | pytorch_crossentropyloss | 25 | 0 | # CrossEntropyLoss¶
Source: https://docs.pytorch.org/docs/2.5/generated/torch.nn.CrossEntropyLoss.html
Version: 2.5
*class* torch.nn.CrossEntropyLoss(*weight=None*, *size\_average=None*, *ignore\_index=-100*, *reduce=None*, *reduction='mean'*, *label\_smoothing=0.0*)[[source]](../_modules/torch/nn/modules/loss.html#C... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_25.md |
70f095b2-9ad3-550a-9da3-a82d6cc1f1da | docs | pytorch | pytorch_crossentropyloss | 25 | 1 | (minibatch,C)(minibatch, C)(minibatch,C) or (minibatch,C,d1,d2,...,dK)(minibatch, C, d\_1, d\_2, ..., d\_K)(minibatch,C,d1,d2,...,dK) with K≥1K \geq 1K≥1 for the
K-dimensional case. The last being useful for higher dimension inputs, such
as computing cross entropy loss per-pixel for 2D images.
The t... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_25.md |
b17133da-1e19-5f12-ba0c-4217c968c0d8 | docs | pytorch | pytorch_crossentropyloss | 25 | 2 | ℓ(x,y)=L={l1,…,lN}⊤,ln=−wynlog∑c=1Cexp(xn,c)exp(xn,yn)⋅1{yn=ignore\_index}
where xxx is the input, yyy is the target, www is the weight,
CCC is the number of classes, and NNN spans the minibatch dimension as well as
d1,...,dkd\_1, ..., d\_kd1,...,dk for the K-dimensional case. If
... | large_dataset/raw/docs/pytorch/crossentropyloss/crossentropyloss_25.md |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.