09-19 11:58
Notice
Recent Posts
Recent Comments
반응형
관리 메뉴

BAN2ARU

[Python / Pytorch] torch.nn.ReLU() 본문

Language/Python

[Python / Pytorch] torch.nn.ReLU()

밴나루 2022. 4. 21. 16:16

https://pytorch.org/docs/stable/generated/torch.nn.ReLU.html를 기반으로 작성하였음

CLASS
torch.nn.ReLU(inplace=False)

Rectified linear unit fuction을 element 별로 적용

$$ ReLU(x) = (x)^{+} = max(0,x) $$


Parameters

  • inplace - 선택적으로 in-place에서 연산을 수행할 수 있으며, default는 False임. (만약 inplace=True로 설정하면 inpurt 들어온 것 자체에서 연산을 수행함)

Shape

  • Input : (*), 여기서 *는 임의의 dimension의 수를 의미함
  • Output : (*), input과 똑같은 shape임.
728x90
Comments