Shortcuts

# ELU¶

class torch.nn.ELU(alpha=1.0, inplace=False)[source]

Applies the Exponential Linear Unit (ELU) function, element-wise, as described in the paper: Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs).

ELU is defined as:

$\text{ELU}(x) = \begin{cases} x, & \text{ if } x > 0\\ \alpha * (\exp(x) - 1), & \text{ if } x \leq 0 \end{cases}$
Parameters
• alpha – the $\alpha$ value for the ELU formulation. Default: 1.0

• inplace – can optionally do the operation in-place. Default: False

Shape:
• Input: $(*)$, where $*$ means any number of dimensions.

• Output: $(*)$, same shape as the input. Examples:

>>> m = nn.ELU()
>>> input = torch.randn(2)
>>> output = m(input) ## Docs

Access comprehensive developer documentation for PyTorch

View Docs

## Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials
{"ft_lang_label":"__label__en","ft_lang_prob":0.7115602,"math_prob":0.98352236,"size":556,"snap":"2022-05-2022-21","text_gpt3_token_len":152,"char_repetition_ratio":0.09057971,"word_repetition_ratio":0.0,"special_character_ratio":0.27517986,"punctuation_ratio":0.21818182,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9975754,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,4,null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-26T04:00:30Z\",\"WARC-Record-ID\":\"<urn:uuid:d6ace950-4d4a-48e3-9eee-5e6efe1f81bb>\",\"Content-Length\":\"41611\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:69b04b05-8bdc-437a-b558-e103397041f0>\",\"WARC-Concurrent-To\":\"<urn:uuid:16c4fb8e-cec6-4c68-a956-07a59acb1174>\",\"WARC-IP-Address\":\"185.199.108.153\",\"WARC-Target-URI\":\"https://pytorch.org/docs/stable/generated/torch.nn.ELU.html\",\"WARC-Payload-Digest\":\"sha1:LZSBPKTXJTZ6EYZYYJL5D64YO4NC2CRR\",\"WARC-Block-Digest\":\"sha1:2WPOQINAT3SDNNHPRSYQJBXWVXAQQ4IJ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662601401.72_warc_CC-MAIN-20220526035036-20220526065036-00529.warc.gz\"}"}