- 博客(7)
- 收藏
- 关注
原创 Tips for DNN
一、原始的网络读取数据时数据已归一化import numpy as npimport tensorflow as tffrom tensorflow import kerasfrom keras.models import Sequentialfrom keras.layers import Densefrom keras.optimizers import SGD,Adam...
2019-10-03 17:31:10 140
原创 【pyTorch】线性回归 Linear Regression
一、导入基本的包import torchimport torch.nn as nnfrom torch.autograd import Variableimport torch.optim as optimimport matplotlib.pyplot as pltimport numpy as np二、数据准备pyTorch中的基本数据类型为Tensor,相当于nump...
2019-09-26 22:10:58 472
原创 【pytorch】分类
# 分类n_data=torch.ones(100,2)# print(n_data)x0=torch.normal(2*n_data,1) #class 0y0=torch.zeros(100)x1=torch.normal(-2*n_data,1) #class 1y1=torch.ones(100)x=torch.cat((x0,x1)).type(torch.floa...
2019-08-04 23:10:56 120
原创 【pytorch】回归
import torchfrom torch.autograd import Variableimport torch.nn.functional as Fimport matplotlib.pyplot as plt# 回归class Net(torch.nn.Module): def __init__(self,n_features,n_hidden,n_output)...
2019-08-04 23:08:59 216
原创 PAT 甲级 1002 A+B for Polynomials (25 分)
This time, you are supposed to findA+BwhereAandBare two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, and each line contains the informa...
2019-08-04 16:28:41 67
原创 线性回归以及梯度下降的实现
线性回归训练模型建立自变量为w和b的损失函数来刻画模型的结果与真实结果之间的距离训练线性回归模型实际上是要找到参数w和b使得loss尽可能小(但不是越小越好,过小可能会造成过拟合问题)。在数学领域,可以使用求极小值或最小值的方法来得到使得loss尽可能小的w和b在机器学习中,使用梯度下降的方法来寻找使得loss尽可能小的w和b梯度下降代...
2019-08-04 14:32:49 143
原创 PAT 甲级 1001 A+B Format (20 分)
Calculatea+band output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Input Specification:Each input ...
2019-08-03 21:08:31 71
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人