파이토치로 구현한 선형회귀
1. 단항 선형 회귀 실습 한 개의 입력이 들어가서 한 개의 출력이 나오는 구조 import torch import torch.nn as nn import torch.optim as optim import matplotlib.pyplot as plt import numpy as np import seaborn as sns x_train = torch.FloatTensor(([1],[2],[3])) y_train = torch.FloatTensor(([2],[4],[6])) print(x_train, x_train.shape) # 결과 : tensor([[1.],[2.],[3.]]) torch.Size([3, 1]) print(y_train, y_train.shape) # 결과 : tensor([[2.],..
2024. 1. 9.