2021年9月2日
摘要: pytorch中的激励函数 以下代码绘制pytorch中的激励函数: import torch from torch.autograd import Variable import torch.nn.functional as F import matplotlib.pyplot as plt im 阅读全文
posted @ 2021-09-02 19:03 菜小疯 阅读(119) 评论(0) 推荐(0)
摘要: Variable类 Variable类在pytorch中定义,以下代码演示Variable的用法: import torch from torch.autograd import Variable import numpy tensor = torch.FloatTensor([[1, 2], [3 阅读全文
posted @ 2021-09-02 17:36 菜小疯 阅读(85) 评论(0) 推荐(0)
摘要: pytorch vs numpy 以下代码比较pytorch和numpy的基本运算功能: import numpy as np import torch np_data = np.arange(6).reshape((2, 3)) print('numpy data:', np_data) torc 阅读全文
posted @ 2021-09-02 16:46 菜小疯 阅读(213) 评论(0) 推荐(0)