随笔分类 -  实验

摘要:1 导入实验所需要的包 import torch import torch.nn as nn import torchvision import torchvision.transforms as transforms import torch.nn.functional as F from tor 阅读全文
posted @ 2022-03-30 09:09 图神经网络 阅读(1173) 评论(0) 推荐(0) 编辑
摘要:1 导入包 import torch import torch.nn as nn import numpy as np import torchvision import torchvision.transforms as transforms import matplotlib.pyplot as 阅读全文
posted @ 2022-03-09 10:17 图神经网络 阅读(582) 评论(0) 推荐(1) 编辑
摘要:1 导入包 import torch import numpy as np import torch.nn as nn from torch.utils.data import TensorDataset,DataLoader import torchvision from IPython impo 阅读全文
posted @ 2022-03-08 17:46 图神经网络 阅读(573) 评论(0) 推荐(0) 编辑
摘要:1 导入实验需要的包 import torch import numpy as np from torch import nn from torchvision.datasets import MNIST import torchvision.transforms as transforms imp 阅读全文
posted @ 2022-03-08 17:00 图神经网络 阅读(586) 评论(0) 推荐(0) 编辑
摘要:1 导入包 import torch import torch.nn as nn from torch.utils.data import TensorDataset,DataLoader from torch.nn import init import torch.optim as optim f 阅读全文
posted @ 2022-03-07 20:30 图神经网络 阅读(514) 评论(0) 推荐(1) 编辑
摘要:1 导入实验需要的包 import torch from torch import nn import numpy as np import matplotlib.pyplot as plt from torch.utils.data import DataLoader,TensorDataset 阅读全文
posted @ 2022-03-07 19:25 图神经网络 阅读(813) 评论(0) 推荐(0) 编辑
摘要:1 导入实验需要的包 import numpy as np import torch from torch import nn from sklearn.model_selection import train_test_split import matplotlib.pyplot as plt f 阅读全文
posted @ 2022-03-06 11:56 图神经网络 阅读(668) 评论(0) 推荐(0) 编辑
摘要:1 导入实验需要的包 import torch import numpy as np import random from IPython import display import matplotlib.pyplot as plt from torch.utils.data import Data 阅读全文
posted @ 2022-03-06 01:11 图神经网络 阅读(878) 评论(0) 推荐(0) 编辑
摘要:1 导入所需要的包 import numpy as np import torch from torch import nn import matplotlib.pyplot as plt from IPython import display from torch.utils.data impor 阅读全文
posted @ 2022-03-05 20:41 图神经网络 阅读(1328) 评论(0) 推荐(0) 编辑
摘要:1 导入numpy包 import numpy as np 2 sigmoid函数 def sigmoid(x): return 1/(1+np.exp(-x)) demox = np.array([1,2,3]) print(sigmoid(demox)) #报错 #demox = [1,2,3] 阅读全文
posted @ 2022-02-04 01:00 图神经网络 阅读(231) 评论(0) 推荐(1) 编辑
摘要:1 导入包 import numpy as np 2 初始化模型参数 ### 初始化模型参数 def initialize_params(dims): w = np.zeros((dims, 1)) b = 0 return w, b 3 损失函数计算 ### 包括线性回归公式、均方损失和参数偏导三 阅读全文
posted @ 2022-01-29 23:34 图神经网络 阅读(314) 评论(0) 推荐(0) 编辑
摘要:1 手写实现PCA import numpy as np class PCA(): # 计算协方差矩阵 def calc_cov(self, X): m = X.shape[0] # 数据标准化,X的每列减去列均值 X = (X - np.mean(X, axis=0)) return 1 / m 阅读全文
posted @ 2022-01-28 18:29 图神经网络 阅读(127) 评论(0) 推荐(0) 编辑
摘要:1 导入相关模块 import numpy as np from collections import Counter import matplotlib.pyplot as plt from sklearn import datasets from sklearn.utils import shu 阅读全文
posted @ 2022-01-28 15:03 图神经网络 阅读(122) 评论(0) 推荐(0) 编辑
摘要:1 导入实验需要的包 import torch import torch.nn as nn import torch.nn.functional import torch.optim as optim import torch.utils.data.dataloader as dataloader 阅读全文
posted @ 2021-12-21 22:33 图神经网络 阅读(157) 评论(0) 推荐(0) 编辑
摘要:参考文档 自编码器及相关变种算法简介 四种类型自编码器AutoEncoders理解及代码实现 堆栈自编码器 Part1 加载项目需要的包 import torch from torch import nn, optim, functional, utils import torchvision fr 阅读全文
posted @ 2021-12-21 21:01 图神经网络 阅读(279) 评论(0) 推荐(0) 编辑
摘要:#导入实验需要的包 import torch import torch.nn as nn import torch.utils.data as Data import torchvision import matplotlib.pyplot as plt from mpl_toolkits.mplo 阅读全文
posted @ 2021-12-21 15:04 图神经网络 阅读(95) 评论(0) 推荐(0) 编辑
摘要:1 import torch from torch import nn,optim from torch.autograd import Variable from torchvision import transforms,datasets from torch.utils.data import 阅读全文
posted @ 2021-12-19 20:06 图神经网络 阅读(48) 评论(0) 推荐(0) 编辑
摘要:计算过程参考:《机器学习——主成分分析(PCA)》 代码: X = np.array([[-1, -2], [-1, 0], [0, 0], [2, 1], [0, 1]]) print(X) def PCA(X,n): #转置 X = np.transpose(X) #求特征的均值 X_mean 阅读全文
posted @ 2021-12-18 22:21 图神经网络 阅读(80) 评论(0) 推荐(0) 编辑
摘要:1 导入实验所需要的包 import torch import torch.nn as nn import numpy as np import torchvision import torchvision.transforms as transforms import matplotlib.pyp 阅读全文
posted @ 2021-11-05 15:44 图神经网络 阅读(1238) 评论(0) 推荐(0) 编辑
摘要:1 导入实验所需要的包 import torch import torch.nn as nn import numpy as np import torchvision import torchvision.transforms as transforms import matplotlib.pyp 阅读全文
posted @ 2021-11-05 15:41 图神经网络 阅读(1008) 评论(0) 推荐(0) 编辑

Live2D