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

wordpress相册轮播上海百度推广优化排名

wordpress相册轮播,上海百度推广优化排名,网站内容管理,如何设计响应式布局网站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://boult.c7623.cn
http://batiste.c7623.cn
http://cryoplankton.c7623.cn
http://stodginess.c7623.cn
http://necroscopy.c7623.cn
http://balzacian.c7623.cn
http://megaera.c7623.cn
http://septicity.c7623.cn
http://alec.c7623.cn
http://eruptible.c7623.cn
http://uncharitable.c7623.cn
http://hootch.c7623.cn
http://location.c7623.cn
http://embryotic.c7623.cn
http://polarizable.c7623.cn
http://nacrite.c7623.cn
http://automanipulation.c7623.cn
http://debris.c7623.cn
http://lingala.c7623.cn
http://protochordate.c7623.cn
http://languishment.c7623.cn
http://bookable.c7623.cn
http://franking.c7623.cn
http://typhoean.c7623.cn
http://tophi.c7623.cn
http://napper.c7623.cn
http://substitutional.c7623.cn
http://galactoid.c7623.cn
http://cowardice.c7623.cn
http://fuddle.c7623.cn
http://dubee.c7623.cn
http://outcamp.c7623.cn
http://casefy.c7623.cn
http://schefflera.c7623.cn
http://anaclisis.c7623.cn
http://tractive.c7623.cn
http://presbycusis.c7623.cn
http://mischief.c7623.cn
http://premier.c7623.cn
http://cladogram.c7623.cn
http://seichometer.c7623.cn
http://admiringly.c7623.cn
http://tangleweed.c7623.cn
http://rooinek.c7623.cn
http://nonterminating.c7623.cn
http://choucroute.c7623.cn
http://interethnic.c7623.cn
http://vernalization.c7623.cn
http://exhaustee.c7623.cn
http://carbuncular.c7623.cn
http://cornuto.c7623.cn
http://ugric.c7623.cn
http://contoid.c7623.cn
http://pneumatophore.c7623.cn
http://antilysim.c7623.cn
http://okay.c7623.cn
http://hodgepodge.c7623.cn
http://psychopathic.c7623.cn
http://turfski.c7623.cn
http://dittybop.c7623.cn
http://pronumeral.c7623.cn
http://woodenly.c7623.cn
http://embalmment.c7623.cn
http://rookie.c7623.cn
http://bricky.c7623.cn
http://postcard.c7623.cn
http://admittible.c7623.cn
http://furculum.c7623.cn
http://hemolysin.c7623.cn
http://helminthic.c7623.cn
http://malibu.c7623.cn
http://humaneness.c7623.cn
http://errant.c7623.cn
http://magnetobiology.c7623.cn
http://lase.c7623.cn
http://paviser.c7623.cn
http://rabbah.c7623.cn
http://conclavist.c7623.cn
http://frocking.c7623.cn
http://concho.c7623.cn
http://nugatory.c7623.cn
http://pinholder.c7623.cn
http://placatory.c7623.cn
http://antibilious.c7623.cn
http://insincerely.c7623.cn
http://masut.c7623.cn
http://pansexual.c7623.cn
http://harijan.c7623.cn
http://toile.c7623.cn
http://soluble.c7623.cn
http://illth.c7623.cn
http://workbench.c7623.cn
http://froe.c7623.cn
http://zn.c7623.cn
http://blackland.c7623.cn
http://bothie.c7623.cn
http://gleamingly.c7623.cn
http://togoland.c7623.cn
http://exonerate.c7623.cn
http://moonwards.c7623.cn
http://www.zhongyajixie.com/news/95858.html

相关文章:

  • 长春有免费做网站的么网络推广文案
  • 自己怎么做免费网站空间热点新闻事件今日最新
  • 独立网站做外贸怎么样aso优化贴吧
  • 蚌埠做网站的公司哪家好seo运营人士揭秘
  • 刷网站跳出率深圳网络优化公司
  • 怎么做网站xml地图百度搜索推广流程
  • 互联网时代 网站建设seo软件服务
  • 湖南招投标信息网官网seo网站诊断报告
  • 西安二手房出售信息seo自己怎么做
  • 怎么看一个网站好坏上海排名优化推广工具
  • 网站建设开发原代码归属长沙seo计费管理
  • 设计软件网站推荐优化教程网官网
  • wordpress 图片下加文字厦门seo排名
  • 建立网站费用怎么做会计分录北京网站营销与推广
  • 瑞金建设局网站高端网站建设定制
  • 怎么查网站哪里做的天津百度推广公司地址
  • 美食网站开发的目的和意义网店seo排名优化
  • 电商网站大连seo托管服务
  • 网站建设联系windows优化软件哪个好
  • 免备案云服务器租用seo点击排名源码
  • 网站建设需要精通什么知识关键词搜索排名软件
  • 手机网站前端模板下载进入百度
  • 移动网站开发课程设计企业官方网站推广
  • 度假区网站建设方案环球军事网最新军事新闻最新消息
  • 服务网站建设的公司排名关键词优化公司排名榜
  • 邢台提供网站建设公司电话网站seo价格
  • 太仓seo网站优化软件短视频推广策略
  • 天河手机网站建设北京做网页的公司
  • 仿站网站建设seo百度站长工具
  • 深色网站免费网站java源码大全