HTML5 学习笔记DAY3

前端基础入门(11)input color 拾色器 将标签的type属性值设置为"color"即可创建一个拾色器。 拾色器功能是HTML5新增。 <!DOCTYPE html> <``html``> <``head``> <``meta charset``=``" utf-8"``> <``meta name``=``"author" content``=``"[http://www.softd... 阅读详情

HTML5 新元素

七.HTML5 新的 Input 类型

HTML5 拥有多个新的表单输入类型。这些新特性提供了更好的输入控制和验证。

注意:并不是所有的主流浏览器都支持新的input类型,不过您已经可以在所有主流的浏览器中使用它们了。即使不被支持,仍然可以显示为常规的文本域。

1.Input 类型: color

color 类型用在input字段主要用于选取颜色

如下所示:从拾色器中选择一个颜色:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>

<form action="demo-form.php">
  选择你喜欢的颜色: <input type="color" name="favcolor"><br>
  <input type="submit">
</form>

</body>
</html>

2.Input 类型: date

date 类型允许你从一个日期选择器选择一个日期。

定义一个时间控制器:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>

<form action="demo-form.php">
  生日 (日期和时间): <input type="datetime" name="bdaytime">
  <input type="submit">
</form>

</body>
</html>

3.Input 类型: datetime-local

datetime-local 类型允许你选择一个日期和时间 (无时区).

定义一个日期和时间 (无时区):

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>

<form action="demo-form.php">
  生日 (日期和时间): <input type="datetime-local" name="bdaytime">
  <input type="submit">
</form>

</body>
</html>

在这里插入图片描述

4.Input 类型: email

email 类型用于应该包含 e-mail 地址的输入域。

在提交表单时,会自动验证 email 域的值是否合法有效:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>
​
<form action="demo-form.php">
  E-mail: <input type="email" name="usremail">
  <input type="submit">
</form>
​
<p><b>注意:</b> Internet Explorer 9  及更早 IE 版本不支持 type="email" 。</p>
​
</body>
</html>

在这里插入图片描述
5.Input 类型: month

month 类型允许你选择一个月份。

定义月与年 (无时区):
生日 (月和年):

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>

<form action="demo-form.php">
  生日 ( 月和年 ): <input type="month" name="bdaymonth">
  <input type="submit">
</form>

</body>
</html>

6.Input 类型: number

number 类型用于应该包含数值的输入域。

定义一个数值输入域(限定):
数量 ( 1 到 5 之间 ):

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>
​
<form action="demo-form.php">
  数量 ( 1 到 5 之间): <input type="number" name="quantity" min="1" max="5">
  <input type="submit">
</form>
​
<p><b>注意:</b>Internet Explorer 9 及更早 IE 版本不支持 type="number" 。</p>
​
</body>

使用下面的属性来规定对数字类型的限定:
在这里插入图片描述
7.Input 类型: range

range 类型用于应该包含一定范围内数字值的输入域。 range 类型显示为滑动条。

定义一个不需要非常精确的数值(类似于滑块控制):

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>
​
<form action="demo-form.php" method="get">
Points: <input type="range" name="points" min="1" max="10">
<input type="submit">
</form>
​
<p><b>注意:</b> Internet Explorer 9 及更早 IE 版本不支持 type="range"。</p>
​
</body>
</html>

在这里插入图片描述
用下面的属性来规定对数字类型的限定:

  • max - 规定允许的最大值
  • min - 规定允许的最小值
  • step - 规定合法的数字间隔
  • value - 规定默认值

8.Input 类型: search

search 类型用于搜索域,比如站点搜索或 Google 搜索。

定义一个搜索字段 (类似站点搜索或者Google搜索):

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>
​
<form action="demo-form.php">
  Search Google: <input type="search" name="googlesearch"><br>
  <input type="submit">
</form>
​
</body>
</html>

9.Input 类型: tel

定义输入电话号码字段:

<body>

<form action="demo-form.php">
  电话号码: <input type="tel" name="usrtel"><br>
  <input type="submit">
</form>

</body>

10.Input 类型: time

time 类型允许你选择一个时间。

<form action="demo-form.php">
  选择时间: <input type="time" name="usr_time">
  <input type="submit">
</form>

11.Input 类型: url

url 类型用于应该包含 URL 地址的输入域。
在提交表单时,会自动验证 url 域的值。

定义可输入时间控制器(无时区):

<form action="demo-form.php">
  添加你的主页: <input type="url" name="homepage"><br>
  <input type="submit">
</form>

12.Input 类型: week

week 类型允许你选择周和年。

定义周和年 (无时区):

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>

<body>

<form action="demo-form.php">
  选择周: <input type="week" name="year_week">
  <input type="submit">
</form>

</body>
</html>

八.HTML5 表单元素

1.HTML5 <datalist> 元素

<datalist> 元素规定输入域的选项列表。
<datalist> 属性规定 form 或 input
域应该拥有自动完成功能。当用户在自动完成域中开始输入时,浏览器应该在该域中显示填写的选项:
使用 <input> 元素的列表属性与 <datalist> 元素绑定.

2.HTML5 <keygen> 元素
`

<keygen> 元素的作用是提供一种验证用户的可靠方法。标签规定用于表单的密钥对生成器字段。

当提交表单时,会生成两个键,一个是私钥,一个公钥。
私钥(private key)存储于客户端,公钥(public key)则被发送到服务器。公钥可用于之后验证用户的客户端证书(client certificate)。

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>
​
<form action="demo_keygen.php" method="get">
  用户名: <input type="text" name="usr_name">
  加密: <keygen name="security">
  <input type="submit">
</form>
​
<p><strong>注意:</strong> Internet Explorer 不支持 keygen 标签。</p>
​
</body>
</html>

3.HTML5 元素

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>
​
<form oninput="x.value=parseInt(a.value)+parseInt(b.value)">0
<input type="range" id="a" value="50">100
+<input type="number" id="b" value="50">
=<output name="x" for="a b"></output>
</form>
​
<p><strong>注意:</strong> Edge 12及更早 IE 版本的浏览器不支持 output 元素。</p>
​
</body>

九.HTML5 表单属性

1.<form> / <input> autocomplete 属性

autocomplete 属性规定 form 或 input 域应该拥有自动完成功能。

当用户在自动完成域中开始输入时,浏览器应该在该域中显示填写的选项。
提示: autocomplete 属性有可能在 form元素中是开启的,而在input元素中是关闭的。
注意: autocomplete 适用于 标签,以及以下类型的 标签:text, search, url, telephone, email, password, datepickers, range 以及 color。

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>
​
<form action="demo-form.php" autocomplete="on">
  First name:<input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  E-mail: <input type="email" name="email" autocomplete="off"><br>
  <input type="submit">
</form>
​
<p>填写并提交表单,然后重新刷新页面查看如何自动填充内容。</p>
<p>注意 form 的 autocomplete 属性为  "on"(开),但是 e-mail 自动为“off”(关)。</p>
​
</body>
</html>

2.<form> novalidate 属性

novalidate 属性是一个 boolean(布尔) 属性.

novalidate 属性规定在提交表单时不应该验证 form 或 input 域。
无需验证提交的表单数据

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>

<form action="demo-form.php" novalidate>
E-mail: <input type="email" name="user_email">
<input type="submit">
</form>

<p><strong>注意:</strong>在 Safari 和 Internet Explorer 9 及之前的版本中不支持 novalidate 属性。</p>

</body>

</html>

3.<input> autofocus 属性

autofocus 属性是一个 boolean 属性.

autofocus 属性规定在页面加载时,域自动地获得焦点。

让 “First name” input 输入域在页面载入时自动聚焦:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>

<form action="demo-form.php">
  First name: <input type="text" name="fname" autofocus><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit">
</form>
<p><strong>注意:</strong> Internet Explorer 9及更早 IE 版本不支持 input 标签的 autofocus 属性。</p>

</body>
</html>

4.<input> form 属性

form 属性规定输入域所属的一个或多个表单。

提示:如需引用一个以上的表单,请使用空格分隔的列表。
位于form表单外的 input 字段引用了 HTML form (该 input 表单仍然属于form表单的一部分):

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>

<form action="demo-form.php">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="提交"><br>
  <input type="submit" formaction="demo-admin.php" value="提交">
</form>
<p><strong>注意:</strong> Internet Explorer 9及更早 IE 版本不支持 input 标签的 formaction 属性。</p>

</body>
</html>

5. formenctype 属性

formenctype 属性描述了表单提交到服务器的数据编码 (只对form表单中 method=“post” 表单)

formenctype 属性覆盖 form 元素的 enctype 属性。

主要: 该属性与 type=“submit” 和 type=“image” 配合使用。

第一个提交按钮已默认编码发送表单数据,第二个提交按钮以 “multipart/form-data” 编码格式发送表单数据:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>

<form action="demo-post-enctype.php" method="post">
  First name: <input type="text" name="fname"><br>
  <input type="submit" value="提交">
  <input type="submit" formenctype="multipart/form-data" value="以 Multipart/form-data 提交">
</form>

<p><strong>注意:</strong> Internet Explorer 9及更早 IE 版本不支持 input 标签的 formenctype 属性。</p>

</body>
</html>

6. formmethod 属性

formmethod 属性定义了表单提交的方式。

formmethod 属性覆盖了 元素的 method 属性。

注意: 该属性可以与 type=“submit” 和 type=“image” 配合使用。

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>

<form action="demo-form.php" method="get">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="提交">
  <input type="submit" formmethod="post" formaction="demo-post.php" value="使用 POST 提交">
</form>

<p><strong>注意:</strong> Internet Explorer 9及更早 IE 版本不支持 input 标签的 formmethod 属性。</p>

</body>
</html>

7. formnovalidate 属性

novalidate 属性是一个 boolean 属性.

novalidate属性描述了 元素在表单提交时无需被验证。

formnovalidate 属性会覆盖 元素的novalidate属性.

注意: formnovalidate 属性与type="submit一起使用

两个提交按钮的表单(使用与不适用验证 ):

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>

<form action="demo-form.php">
  E-mail: <input type="email" name="userid"><br>
  <input type="submit" value="提交"><br>
  <input type="submit" formnovalidate="formnovalidate" value="不验证提交">
</form>

<p><strong>注意:</strong> Internet Explorer 9及更早 IE 版本,或 Safari 不支持 input 标签的 formnovalidate 属性。</p>

</body>
</html>

8. formtarget 属性

formtarget 属性指定一个名称或一个关键字来指明表单提交数据接收后的展示。

The formtarget 属性覆盖 元素的target属性.

注意: formtarget 属性与type=“submit” 和 type="image"配合使用.

两个提交按钮的表单, 在不同窗口中显示:

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>菜鸟教程(runoob.com)</title> 
</head>
<body>
​
<form action="demo-form.php">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="正常提交">
  <input type="submit" formtarget="_blank" value="提交到一个新的页面上">
</form>
​
<p><strong>注意:</strong> Internet Explorer 9及更早 IE 版本不支持 input 标签的 formtarget 属性。</p>
​
</body>
</html>
【数字IC刷题】华为海思数字IC笔试题(3)详细解析版 阅读详情

相关推荐

Type-C连接中的CC引脚:Rp与Rd电阻的识别与供电模式选择

本文深入解析Type-C接口中CC引脚的核心功能,包括Rp与Rd电阻的识别原理及供电模式选择机制。通过详细的分压计算和实战案例,揭示Type-C设备如何通过CC引脚实现方向检测、角色识别和供电协商,为硬件设计提供关键指导。

weixin_30616969的博客 341

HTML5之input的类型color,通过input:color来改变背景颜色或者字体颜色

问题所在:改变了拾色器中颜色的值后并没有在相关元素上体现出来 &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;CSS Variables&lt;/title&gt; &lt;link

祥哥的说 2万+

Windows 环境下 OpenClaw 的安装与千问大模型配置

为了不占用 C 盘空间,重装系统也不丢失配置,本文详细记录了如何将 OpenClaw 安装在非系统盘,比如D 盘,并对接阿里云 通义千问大模型的全过程。主要是利用 NVM 和 npm 进行安装,方便后续一键升级,配置具有免费额度的Qwen API,这个只需要在阿里云百炼注册一个账号就能获得免费额度。

博客 6538

HTML5 新的 Input 类型

HTML5 拥有多个新的表单输入类型。这些新特性提供了更好的输入控制和验证。并不是所有的主流浏览器都支持新的input类型,不过您已经可以在所有主流的浏览器中使用它们了。即使不被支持,仍然可以显示为常规的文本域。

dodo2016的博客 2060

避坑指南:sherpa-onnx中文语音识别模型实测对比(2024最新版)

本文实测对比了sherpa-onnx框架下Paraformer、Zipformer、SenseVoice等主流中文语音识别模型。针对不同应用场景,从准确率、延迟、资源占用等维度提供选型建议,并分享部署避坑指南与最佳实践,帮助开发者高效选择本地语音转文字方案。

xray4的博客 2278

将3DMax编辑的动画,导入给已经绑定蒙皮好的模型给Unity使用

现在程序猿想做独立游戏,即容易,也难。 说容易,引擎越来越傻瓜化。 说难,到哪去找靠谱的美术? 好在伟大的AssetStore(还有淘宝上)有大批不赖的资源可以用。 现成的模型,是好,但是,没有配套的动作,却是一件让人头疼的事情,即使用IK动画,也不能完美的弥补这一缺陷。 虽然Unity具备 retargeting 功能,但是,也不是万能的,很多情况下,非标准的骨骼会导致

正经的时候都在打游戏 1万+

HTML5的input color系统颜色选择器

前两天,我写了一篇《推荐两款jQuery色盘选择器》介绍,那是使用JavaScript实现的色盘,今天我给大家介绍HTML5的色盘选择器。HTML5有一个input类型为color,即颜色选择器。 认识html5中的color <input type="color" /> Chrome执行: Opera: 其它浏览器Firefox、IE暂不支持,Safari最...

weixin_34209851的博客 2519

用AI+Playwright实现零代码UI自动化测试:以登录页面为例的实战指南

本文详细介绍了如何利用AI与Playwright结合实现零代码UI自动化测试,特别以登录页面为例进行实战演示。通过自然语言描述生成测试脚本,大幅降低技术门槛,提升测试效率,并支持跨浏览器验证。适合非技术人员快速上手专业级自动化测试。

weixin_28842269的博客 402

html5颜色选择按钮,H5的input color系统颜色选择器

今天我给大家介绍HTML5的色盘选择器。HTML5有一个input类型为color,即颜色选择器。(《推荐两款jQuery色盘选择器》介绍,那是使用JavaScript实现的色盘)认识html5中的colorChrome执行:Opera:其它浏览器Firefox、IE暂不支持,Safari最新版本已支持。color标签最强大的一点是直接能调用系统的颜色调节窗口,上面截图Chrome的运行效果中弹出...

weixin_34803738的博客 4529

Odoo 集成ReportBro报表设计器支持13,14,15,16,17,18,19

Odoo 集成ReportBro零代码报表设计器,ReportBro设计器 一个用于创建PDF和XLSX报告模板的javascript插件。

zxltwins的博客 3377

ConnectionResetError 10054 根因分析与全链路防御指南

ConnectionResetError(错误码10054)是TCP协议中服务端主动发送RST包导致的强制断连,本质并非网络连接失败,而是服务端基于空闲超时、连接满载、TLS协商失败等策略做出的确定性终止决策。理解其底层原理有助于跳出‘重试’误区,转向连接生命周期管理。该错误高频出现在HTTP长连接、WebSocket、第三方API对接等场景,尤其在Nginx反向代理、负载均衡器(如AWS ALB)、WAF设备及内核conntrack机制下极易触发。本文结合Wireshark抓包分析、客户端心跳保鲜、协议指

weixin_30225755的博客 639

pink老师HTML5+CSS3学习笔记 | DAY3

2023.3.10

m0_53454320的博客 404

weblogic启动异常故障处理(boot认证失败)

root 用户生成的文件属主为 root,WebLogic进程将无权读取,直接导致认证失败。· ⚠️ 密码必须完全一致:第3步 AdminAccount 命令中设置的密码,与第5步所有 boot.properties 文件中 password= 字段的值,必须保证完全一致。如果您的域下配置了受管服务器实例(如 ms_server1、ms_server2 等),必须逐一更新各实例下的免密启动文件,确保实例重启时密码与AdminServer保持一致,否则实例启动会因认证失败而报错。此步骤至关重要,必须执行。

weixin_53389944的博客 222

pink老师HTML5+CSS3学习笔记 | DAY1

2023/3/8

m0_53454320的博客 917

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain&#39;s apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath(&#39;DeepLearnToolbox&#39;));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand(&#39;state&#39;,0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = &#39;sigm&#39;;%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, &#39;Too big error&#39;);```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, &#39;Too big error&#39;);```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

pink老师HTML5+CSS3学习笔记 | DAY18

属性选择器、结构伪类选择器、伪元素选择器、盒子模型、图片模糊、calc函数、过渡 2023.3.30

m0_53454320的博客 244

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

pink老师HTML5+CSS3学习笔记 | DAY16

精灵图、字体图标、字体图标的使用和追加、小三角制作、鼠标样式cursor、轮廓线 outline、防止拖拽文本域resize、利用vertical-align实现垂直居中、溢出文字省略号代替、常用布局技巧、Unicode编码字体; 2023.3.28

m0_53454320的博客 220

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

HTML5学习笔记-Day3

Day3 CSS选择器 格式化文本 标签选择器 p {} 类选择器 .className {key: vakue;} id选择器 #idName {key: value;} 通配符选择器 * {key: value} <head> <style>//css写在head标签里面 body { background-color: red; font-style: normal; // italic-斜体 font-weight: normal; // bold(700)粗|bolde

qq_38066597的博客 115

pink老师HTML5+CSS3学习笔记 | DAY5

2023.3.12

m0_53454320的博客 262

web前端开发html5+css3学习笔记day1

课程简介、网页简史、html简介、编写简易网页、自结束标签及注释、标签中的属性、文档声明、进制的基础知识、字符编码、文档的使用、vscode的安装、配置liveserver、实体、meta标签、语义化标签、块和行内、列表、超链接

weixin_44647089的博客 493

【前端学习笔记day37】6. HTML5与CSS3

文章目录6. HTML5与CSS3课程介绍 6. HTML5与CSS3 课程介绍 学习html5和CSS3的新增功能,了解html5和css3的应用场景。

汪雯琦的博客 444

前端Web开发HTML5+CSS3(黑马学习笔记)-day01

<title>网页标题</title>

weixin_46122939的博客 1163

web前端开发html5+css3(入门学习笔记)(day14)

所需ps的小技巧、背景的四个属性,背景(总结的9个属性),背景的练习(通过一个像素的图片做背景图),按钮练习(文字指示区域有待优化),按钮练习优化2.0

weixin_44647089的博客 256

pink老师HTML5+CSS3学习笔记 | DAY2

2023/3/9

m0_53454320的博客 311

前端Web开发HTML5+CSS3(黑马学习笔记)-day02

<dt>列表标题</dt><dd>列表描述详情</dd>……

weixin_46122939的博客 910

前端Web开发HTML5+CSS3(黑马学习笔记)-day05

技巧:从左上角开始顺时针赋值,当前角没有数值则与对角取值相同。胶囊形状:给长方形盒子设置圆角属性值为 盒子高度的一半。作用:设置 内容 与 盒子边缘 之间的距离。,用来 设置伪元素的内容,如果没有内容,则。清除标签默认的样式,比如:默认的内外边距。正圆形状:给正方形盒子设置圆角属性值为。作用:控制溢出元素的内容的显示方式。场景:父子级的标签,子级的添加。作用:设置元素的外边框为圆角。作用:拉开两个盒子之间的距离。赋值,当前方向没有数值则与。作用:给元素设置阴影效果。方位名词首字母,例如,

weixin_46122939的博客 689

pink老师HTML5+CSS3学习笔记 | DAY17

html5新特性:新增语义化标签、新增多媒体标签、新增input标签、新增表单属性 2023.3.29

m0_53454320的博客 126
上一篇: HTML5 学习笔记DAY2(2)
下一篇: HTML5 学习笔记DAY4
using131
博客等级 码龄6年 2粉丝 21原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值