본문 바로가기
공부기록/[PyTorch]

Introduction to Deep Learning with PyTorch - [Chapter 1]

by RiverWon 2024. 4. 12.

Datacamp 무료계정이 있어서 각잡고 밑바닥부터인 PyTorch공부를 해 보려 한다. 정리는 거의 캡쳐한 거 위주로 나중에 다시 봤으면 좋겠다 싶은 것만 가져왔다.

실습코드로 공부하는 PyTorch도 진행할 예정

 

Chapter 1 : Introduction to deep learning with PyTorch

 

  • You can use the .from_numpy() function to convert a NumPy array to a tensor.
  • Tensor subtraction, addition, and element-wise multiplication have the same syntax as their NumPy counterparts.
import torch

# Create two tensors from the arrays
tensor_a = torch.from_numpy(array_a)
tensor_b = torch.from_numpy(array_b)

 

in_features : the number of input tensor

out_features : the number of output tensor

Activation Function - adding nonlinear to a model

sigmoid의 input_tensor은 1-dimension이어야 함

 

Note. Sigmoid as last step in network of linear layers is equivalent to traditional logistic regression.

 

What about multiple classification? - SoftMax

dim = -1 indicates softmax is applied to the input tensor's last dimension

 

 

Chapter1 끗. 정말 기본적인 내용 설명했음