摘要:
1 import torch 2 import torch.nn.functional as F 3 4 # 1prepare dataset 5 x_data = torch.Tensor([[1.0], [2.0], [3.0]]) 6 y_data = torch.Tensor([[0], [ 阅读全文
摘要:
1 import torch 2 3 # 1prepare dataset 4 # x,y是矩阵,3行1列 也就是说总共有3个数据,每个数据只有1个特征 5 x_data = torch.tensor([[1.0], [2.0], [3.0]]) 6 y_data = torch.tensor([[ 阅读全文
摘要:
1 import torch 2 from matplotlib import pyplot as plt 3 import os 4 os.environ['KMP_DUPLICATE_LIB_OK']='True' 5 6 x_data = [1.0, 2.0, 3.0] 7 y_data = 阅读全文