torch.nn.Linear(*in_features*, *out_features*, *bias=True*, *device=None*, *dtype=None*)
Parameters
- in_features (int): size of each input sample
- out_features (int): size of each output sample
- bias (bool): If set to
False
, the layer will not learn an additive bias. Default:True
Shape
- Input
- $(*,H_{in})$ where �닓 means any number of dimensions including none
- $(*,H_{in})= in_features$
- Output
- $(*,H_{out})$ where all but the last dimension are the same shape as the input
- $(*,H_{out})=out_features$
Variables
- weight (torch.Tensor): learnable weights of the module of shape $(out_features, in_features)$
- bias
- learnable bias of the module of shape $(out_features)$
- if
bias
isTrue
, the values are initialized
'ML & DL > PyTorch' 카테고리의 다른 글
no_grad vs. requires_grad (0) | 2023.02.20 |
---|---|
Dataset & DataLoader (0) | 2023.02.20 |
torch.optim.Optimizer (0) | 2023.02.20 |