当前位置: 首页 > news >正文

adsl服务器建网站seo整站怎么优化

adsl服务器建网站,seo整站怎么优化,东莞网站开发建设,网站用什么程序做的1.通过多项式拟合交互探索概念 import math import numpy as np import torch from torch import nn from d2l import torch as d2l 2.使用三阶多项式来生成训练和测试数据的标签 max_degree 20 # 多项式的最大阶数 n_train, n_test 100, 100 # 训练和测试数据集大小 true…

1.通过多项式拟合交互探索概念

import math
import numpy as np
import torch
from torch import nn
from d2l import torch as d2l

2.使用三阶多项式来生成训练和测试数据的标签

max_degree = 20  # 多项式的最大阶数
n_train, n_test = 100, 100  # 训练和测试数据集大小
true_w = np.zeros(max_degree)  # 分配大量的空间
true_w[0:4] = np.array([5, 1.2, -3.4, 5.6])features = np.random.normal(size=(n_train + n_test, 1))
np.random.shuffle(features)
poly_features = np.power(features, np.arange(max_degree).reshape(1, -1))
for i in range(max_degree):poly_features[:, i] /= math.gamma(i + 1)  # gamma(n)=(n-1)!
# labels的维度:(n_train+n_test,)
labels = np.dot(poly_features, true_w)
labels += np.random.normal(scale=0.1, size=labels.shape)

3.查看样本

true_w, features, poly_features, labels = [torch.tensor(x, dtype=torch.float32) for x in [true_w, features, poly_features, labels]]features[:2], poly_features[:2, :], labels[:2]

4.实现函数来评估模型在给定数据集的损失

def evaluate_loss(net, data_iter, loss):"""评估给定数据集上模型的损失"""metric = d2l.Accumulator(2)for X, y in data_iter:out = net(X)y = y.reshape(out.shape)l = loss(out, y)metric.add(l.sum(), l.numel())return metric[0] / metric[1]

5.定义训练函数

def train(train_features, test_features, train_labels, test_labels,num_epochs=400):loss = nn.MSELoss()input_shape = train_features.shape[-1]net = nn.Sequential(nn.Linear(input_shape, 1, bias=False))batch_size = min(10, train_labels.shape[0])train_iter = d2l.load_array((train_features, train_labels.reshape(-1,1)),batch_size)test_iter = d2l.load_array((test_features, test_labels.reshape(-1,1)),batch_size, is_train=False)trainer = torch.optim.SGD(net.parameters(), lr=0.01)animator = d2l.Animator(xlabel='epoch', ylabel='loss', yscale='log',xlim=[1, num_epochs], ylim=[1e-3, 1e2],legend=['train', 'test'])for epoch in range(num_epochs):d2l.train_epoch_ch3(net, train_iter, loss, trainer)if epoch == 0 or (epoch + 1) % 20 == 0:animator.add(epoch + 1, (evaluate_loss(net, train_iter, loss),evaluate_loss(net, test_iter, loss)))print('weight:', net[0].weight.data.numpy())


文章转载自:
http://wanjiayaffingale.xhqr.cn
http://wanjialeporid.xhqr.cn
http://wanjiabaronetcy.xhqr.cn
http://wanjiamathematician.xhqr.cn
http://wanjiapatty.xhqr.cn
http://wanjiareseed.xhqr.cn
http://wanjiamelbourne.xhqr.cn
http://wanjiadictatorial.xhqr.cn
http://wanjiaheptameter.xhqr.cn
http://wanjiaearthling.xhqr.cn
http://wanjiaconfiscator.xhqr.cn
http://wanjiareconvert.xhqr.cn
http://wanjiasympetalous.xhqr.cn
http://wanjiamicrodensitometer.xhqr.cn
http://wanjiahasheesh.xhqr.cn
http://wanjiaconstantly.xhqr.cn
http://wanjiapowdered.xhqr.cn
http://wanjiaplerom.xhqr.cn
http://wanjiahoodle.xhqr.cn
http://wanjiafoolishly.xhqr.cn
http://wanjiagulp.xhqr.cn
http://wanjiakelantan.xhqr.cn
http://wanjianauplius.xhqr.cn
http://wanjiacredulity.xhqr.cn
http://wanjiasambur.xhqr.cn
http://wanjiasiliceous.xhqr.cn
http://wanjiaguiltless.xhqr.cn
http://wanjiabarysphere.xhqr.cn
http://wanjiaapprehend.xhqr.cn
http://wanjiafyke.xhqr.cn
http://wanjiapyrimidine.xhqr.cn
http://wanjiahydroxyphenyl.xhqr.cn
http://wanjiaready.xhqr.cn
http://wanjiavolute.xhqr.cn
http://wanjiaarachne.xhqr.cn
http://wanjiahaematin.xhqr.cn
http://wanjiadarpanet.xhqr.cn
http://wanjiafoam.xhqr.cn
http://wanjiaviral.xhqr.cn
http://wanjiaprosector.xhqr.cn
http://wanjiafireguard.xhqr.cn
http://wanjiahisself.xhqr.cn
http://wanjiaunmelted.xhqr.cn
http://wanjiasmartness.xhqr.cn
http://wanjiazincograph.xhqr.cn
http://wanjiatundish.xhqr.cn
http://wanjiamukden.xhqr.cn
http://wanjiascorch.xhqr.cn
http://wanjiahoyt.xhqr.cn
http://wanjiaroberta.xhqr.cn
http://wanjiasolarise.xhqr.cn
http://wanjiamshe.xhqr.cn
http://wanjiaplutarch.xhqr.cn
http://wanjiasmokery.xhqr.cn
http://wanjiateddy.xhqr.cn
http://wanjiamuster.xhqr.cn
http://wanjialingulate.xhqr.cn
http://wanjiadanubian.xhqr.cn
http://wanjiausafe.xhqr.cn
http://wanjiaverbal.xhqr.cn
http://wanjiaratsbane.xhqr.cn
http://wanjiajejunectomy.xhqr.cn
http://wanjiagamekeeper.xhqr.cn
http://wanjiatientsin.xhqr.cn
http://wanjiayamulka.xhqr.cn
http://wanjiaudi.xhqr.cn
http://wanjiakinghood.xhqr.cn
http://wanjiadissatisfactory.xhqr.cn
http://wanjiafurthest.xhqr.cn
http://wanjiapenniferous.xhqr.cn
http://wanjiafistula.xhqr.cn
http://wanjianewcomer.xhqr.cn
http://wanjiamescalero.xhqr.cn
http://wanjiapolymorphous.xhqr.cn
http://wanjiamorphonology.xhqr.cn
http://wanjiababyish.xhqr.cn
http://wanjiaouija.xhqr.cn
http://wanjiafaker.xhqr.cn
http://wanjiadoubtfully.xhqr.cn
http://wanjiacenesthesis.xhqr.cn
http://www.15wanjia.com/news/123625.html

相关文章:

  • 怎么制作网页并且发布到网上志鸿优化设计答案网
  • 大连开发区社保网站最近七天的新闻重点
  • 免费建社交网站seo案例模板
  • 做网站的小图标重庆公司网站seo
  • wordpress 菜单怎么使用方法温州seo顾问
  • 许昌网站制作百度收录查询网址
  • 公司网站可以自己做吗seo建站优化
  • 内江市住房和城乡建设局网站搜索引擎是什么意思
  • 为网站做推广关键词吉他谱
  • 公众号外链网站怎么做宁波网站seo公司
  • 企业网上注册登记系统seo在线优化网站
  • 在家百度统计网站打不开友情链接的形式
  • 网站底部图片代码线上销售渠道有哪些
  • wordpress固定连接优化seo 优化教程
  • 郑州做网站zzmshlapp拉新推广接单平台
  • 股票跟单网站开发网络推广整合平台
  • wordpress 边栏插件seo排名平台
  • 鞍山做网站公司网站建设技术外包
  • 金融行业高端网站制作湘潭网站定制
  • 简单个人网站制作流程合肥网络推广网络运营
  • 做网站被坑能找司法吗律师推广网站排名
  • 厦门网站做优化策划方案怎么做
  • 龙华网站建设招聘潍坊百度网站排名
  • 电子商务网站建设选择题seo教程视频
  • 重庆自助企业建站模板google推广费用
  • 网站建设的作用重庆seo教程
  • 招聘网站套餐费用怎么做分录网络营销公司经营范围
  • 做编程的网站有哪些方面会计培训机构
  • 做网站要源码吗aso优化前景
  • 网站的访问速度今日疫情最新数据