Dev record
[Python] import torch.nn as nn 역할
Barrer
2023. 8. 14. 10:19
반응형
import torch.nn as nn
딥러닝을 배우면서 pytorch를 쓰기 시작하면 다음과 같은 코드를 많이 봤을 것이다.
torch.nn은 neural network (인공 신경망) 에 사용되는 다양한 클래스와 모듈이 포함되어있다.
예를 들어 위 코드에서도 보면 torch.nn을 import 하고 Linear, ReLU 등을 사용하는 것을 볼 수 있다.
https://pytorch.org/docs/stable/nn.html
torch.nn — PyTorch 2.0 documentation
Shortcuts
pytorch.org
파이토치 공식 문서를 보면 딥러닝에서 사용되는 다양한 layer, container 등을 확인 할 수 있다.
반응형