Extjs layout布局

黑猫带你学eMMC协议第2篇:eMMC部分相关名词释义 1 前言 1.1 声明 本文依据eMMC JEDEC5.1、网络资料及个人工作经验整理而成,如有错误请留言。 本文结合eMMC JEDEC5.1协议手册查看效果更佳。 1.2 本文背景 本文关键词不包括emmc jedec5.1协议第3章节:《Terms and definitions》内容。关于emmc协议层的关键词,直接查阅spec相关章节即可,清晰明了,此处没必要再列出。 本文为本人工作学习中常听到或常用到关乎于emmc/flash的一些关键词合集,没有固定分类,不需要强行记忆,供查询使用。 1. 阅读详情

http://www.cnblogs.com/lipan/archive/2011/12/27/2302719.html



一、absolute

这种方式的布局可以对子元素相对于父级容器控件进行绝对定位,它包含了x、y两个配置项用于定位。

我们来看看一个例子:

[Js]
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//absolute
Ext.create( 'Ext.Panel' , {
     title: '容器面板' ,
     renderTo: 'div1' ,
     width: 400,
     height: 300,
     layout: 'absolute' ,
     items: [{
         title: '面板1' ,
         xtype: "panel" ,
         html: "子元素1" ,
         width: 200,
         height: 100,
         x: 50,
         y: 50
 
     }, {
         title: '面板2' ,
         xtype: "panel" ,
         html: "子元素2" ,
         width: 200,
         height: 100,
         x: 100,
         y: 80
 
     }]
});

效果如下:

二、accordion

有的js插件里面accordion都是一个ui控件,但是Ext是通过布局的方式实现的,我们可以用面板控件作为它的折叠项,并且还可以用js来翻动活动项。

[Js]
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//accordion
Ext.create( 'Ext.Panel' , {
     title: '容器面板' ,
     renderTo: 'div2' ,
     width: 400,
     height: 300,
     layout: 'accordion' ,
     items: [{
         tools: [{ type: 'gear' , handler: function () {
             Ext.Msg.alert( '提示' , '配置按钮被点击。' );
         }
         }, { type: 'refresh' }],
         title: '面板1' ,
         xtype: "panel" ,
         html: "子元素1"
 
     }, {
         title: '面板2' ,
         xtype: "panel" ,
         html: "子元素2"
     }, {
         id: 'panel3' ,
         title: '面板3' ,
         xtype: "panel" ,
         html: "子元素3"
     }]
});
Ext.create( "Ext.Button" , {
     renderTo: 'div2' ,
     text: "打开第三页" ,
     handler: function () {
         Ext.getCmp( 'panel3' ).expand( true );
     }
});

效果如下:

三、anchor

这个布局就是表单面板默认支持的,每一项占据一行,支持用anchor配置项分配各个子项的高度和宽度。为百分比时表示当前大小占父容器的百分比,为数字的时一般为负数,表示父容器的值减去差值,剩下的为子项的大小。

[Js]
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//anchor
Ext.create( 'Ext.Panel' , {
     title: '容器面板' ,
     renderTo: 'div3' ,
     width: 400,
     height: 300,
     layout: 'anchor' ,
     items: [{
         tools: [{ type: 'gear' , handler: function () {
             Ext.Msg.alert( '提示' , '配置按钮被点击。' );
         }
         }, { type: 'refresh' }],
         title: '面板1' ,
         xtype: "panel" ,
         html: "子元素1" ,
         anchor: '80% 20%'
 
     }, {
         title: '面板2' ,
         xtype: "panel" ,
         html: "子元素2" ,
         anchor: '-50 -200'
     }, {
         title: '面板3' ,
         xtype: "panel" ,
         html: "子元素3" ,
         anchor: '100% 30%'
     }]
});

效果如下:

四、border

这个布局可以定义东南西北四个方向的子元素,还有一个居中的子元素,一般用它来做页面整页布局,所以Ext.container.Viewport默认就支持了这个布局方式。

[Js]
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//border
Ext.create( 'Ext.Panel' , {
     title: '容器面板' ,
     renderTo: 'div4' ,
     width: 400,
     height: 300,
     layout: 'border' ,
     defaults: {
         split: true ,                 //是否有分割线
         collapsible: true ,           //是否可以折叠
         bodyStyle: 'padding:15px'
     },
     items: [{
         region: 'north' ,            //子元素的方位:north、west、east、center、south
         title: '北' ,
         xtype: "panel" ,
         html: "子元素1" ,
         height: 70
     }, {
         region: 'west' ,
         title: '西' ,
         xtype: "panel" ,
         html: "子元素2" ,
         width: 100
 
     }, {
         region: 'east' ,
         title: '东' ,
         xtype: "panel" ,
         html: "子元素2" ,
         width: 100
 
     }, {
         region: 'center' ,
         title: '主体' ,
         xtype: "panel" ,
         html: "子元素3"
     }, {
         region: 'south' ,
         title: '南' ,
         xtype: "panel" ,
         html: "子元素4" ,
         height: 70
     }]
});

效果如下:

五、card

这个布局可以像卡片一样的切换每个子元素,各个子元素都会独占父元素的容器空间。我们可以定义翻页按钮来控制当前处于活动状态的子元素。

[Js]
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//card
var cardNav = function (incr) {
     var l = Ext.getCmp( 'cardPanel' ).getLayout();
     var i = l.activeItem.id.split( 'card' )[1];
     var next = parseInt(i, 10) + incr;
     l.setActiveItem(next);
     Ext.getCmp( 'cardPrev' ).setDisabled(next === 0);
     Ext.getCmp( 'cardNext' ).setDisabled(next === 2);
};
Ext.create( 'Ext.Panel' , {
     title: '容器面板' ,
     renderTo: 'div5' ,
     width: 400,
     height: 300,
     layout: 'card' ,
     activeItem: 1,                  //默认活动项
     id: 'cardPanel' ,
     items: [{
         id: 'card0' ,
         title: '面板1' ,
         xtype: "panel" ,
         html: "子元素1"
 
     }, {
         id: 'card1' ,
         title: '面板2' ,
         xtype: "panel" ,
         html: "子元素2"
     }, {
         id: 'card2' ,
         title: '面板3' ,
         xtype: "panel" ,
         html: "子元素3"
     }],
     bbar: [ '->' , {
         id: 'cardPrev' ,
         text: '« 前一页' ,
         handler: Ext.Function.bind(cardNav, this , [-1])
     }, {
         id: 'cardNext' ,
         text: '后一页 »' ,
         handler: Ext.Function.bind(cardNav, this , [1])
     }]
 
});

效果如下:

六、column

这个布局把子元素按照列进行划分。

[Js]
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//column
Ext.create( 'Ext.Panel' , {
     title: '容器面板' ,
     renderTo: 'div6' ,
     width: 400,
     height: 300,
     layout: 'column' ,
     defaults: {                     //设置没一列的子元素的默认配置
         layout: 'anchor' ,
         defaults: {
             anchor: '100%'
         }
     },
     items: [{
         columnWidth: 4 / 10,        //设置列的宽度
         items: [{
             title: '面板1' ,
             border: false ,
             html: '子元素1'
         }, {
             title: '面板2' ,
             border: false ,
             html: '子元素2'
         }]
     }, {
         width: 120,
         items: [{
             title: '面板3' ,
             border: false ,
             html: '子元素3'
         }]
     }, {
         columnWidth: .40,
         items: [{
             title: '面板4' ,
             border: false ,
             html: '子元素4'
         }]
     }]
 
});

效果如下:

七、fit

这个布局下子元素会独占全部的容器空间,一般用于只有一个子项的情况。

[Js]
?
1
2
3
4
5
6
7
8
9
10
11
12
13
//fit
Ext.create( 'Ext.Panel' , {
     title: '容器面板' ,
     renderTo: 'div7' ,
     width: 400,
     height: 300,
     layout: 'fit' ,
     items: [{
         title: '面板' ,
         html: '子元素' ,
         border: false
     }]
});

效果如下:

八、table

这个布局用表格定位的方式去组织子元素,我们可以像表格一样设置rowspan和colspan。

[Js]
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//table
Ext.create( 'Ext.Panel' , {
     title: '容器面板' ,
     renderTo: 'div8' ,
     width: 400,
     height: 300,
     layout: {
         type: 'table' ,
         columns: 4
     },
     defaults: { frame: true , width: 70, height: 50 },
     items: [
         { html: '元素1' , rowspan: 3, height: 150 },
         { html: '元素2' , rowspan: 2, height: 100 },
         { html: '元素3' },
         { html: '元素4' },
         { html: '元素5' , colspan: 2, width: 140 },
         { html: '元素6' },
         { html: '元素7' },
         { html: '元素8' }
     ]
});

效果如下:

九、vbox

这个布局把所有的子元素按照纵向排成一列。

[Js]
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//vbox
Ext.create( 'Ext.Panel' , {
     title: '容器面板' ,
     renderTo: 'div9' ,
     width: 400,
     height: 300,
     layout: {
         type: 'vbox' ,
         pack: 'start' ,              //纵向对齐方式 start:从顶部;center:从中部;end:从底部
         align: 'stretchmax'             //对齐方式 center、left、right:居中、左对齐、右对齐;stretch:延伸;stretchmax:以最大的元素为标准延伸
     },
     defaults: {
         xtype: 'button'
     },
     items: [{
         text: '小按钮' ,
         flex: 1                      //表示当前子元素尺寸所占的均分的份数。
     }, {
         xtype: 'tbspacer' ,          //插入的空填充
         flex: 3
     },
 
     {
         text: '中按钮' ,
         scale: 'medium'
     }, {
         text: '大按钮' ,
         width: 120,
         scale: 'large' ,
         flex: 1
     }]
});

效果如下:

十、hbox

跟vbox类似,只不过变成了横向的。

[Js]
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//hbox
Ext.create( 'Ext.Panel' , {
     title: '容器面板' ,
     renderTo: 'div10' ,
     width: 400,
     height: 300,
     layout: {
         type: 'hbox' ,
         pack: 'end' ,
         align: 'middle'             //对齐方式 top、middle、bottom:顶对齐、居中、底对齐;stretch:延伸;stretchmax:以最大的元素为标准延伸
     },
     defaults: {
         xtype: 'button'
     },
     items: [{
         text: '小按钮'
     },{
         text: '中按钮' ,
         scale: 'medium'
     }, {
         text: '大按钮' ,
         width: 120,
         scale: 'large'
     }]
});

效果如下:


腾讯Android高级开发工程师面试指南与参考答案 腾讯深圳元宝高级Android开发工程师岗位招聘,要求3-5年Android开发经验,熟悉Kotlin、性能优化和架构设计。岗位职责包括元宝App架构研发、稳定性优化及跨团队协作。面试分3轮,流程较快,主要考察技术能力(Kotlin、算法)、架构设计及项目经验。重点准备性能优化案例、多线程编程及Compose开发等加分项。无AI项目经验也可应聘,需突出Android开发能力。建议复习MVVM架构、JNI等技术,并准备项目优化案例。 阅读详情

相关推荐

警惕!数字签名伪造的攻防演练:用SigThief克隆证书的真实测试(Windows环境)

本文深入探讨了Windows环境下数字签名伪造的攻防技术,详细介绍了使用SigThief工具进行签名提取与克隆的实战步骤。通过真实测试案例,揭示了数字签名安全机制的潜在漏洞,并提供了有效的防御策略和检测技术,帮助安全人员提升系统防护能力。

weixin_42530732的博客 416

[ExtJS]Layout 布局

在ExtJS里,布局形态用layout, 用法如下: { xtype:'容器控件', layout:'布局类型', items:[ { xtype:'子控件1' }, { xtype:'子控件2' } ] } 上述代码翻译成人话就是: 让某个容器...

拒绝成猿的程序员 1055

修复ASUS in WinRE教程

暑假入手了天选三,发现是win11家庭版,本来想着家庭版将就一下无所谓,结果在使用的过程中发现相较于专业版真的是不能比,于是自己就重装了系统,发现ASUS in WinRE入口不见了,折腾半天最后成功修复。

weixin_46202629的博客 1万+

Extjs布局——layout: 'card'

先看下此布局的特性: 下面演示一个使用layout: 'card'布局的示例(从API copy过来的)——导航面板(注:导航面板切换下一个或上一个面板实际是导航面板的布局--layout调用指定的方法。) //导航 var navigate = function(panel, direction){//panel:导航面板;direction:layout调用的方法...

weixin_30346033的博客 154

Vue中实现word文档渲染、在线编辑、保存

Vue3对word文档进行渲染、编辑、保存。word转成html,html转成word

h18749849699的博客 1340

解决Calibre中license的错误

本次解决了Calibre在Cadence 617 virtuoso版本中运行不了的错误,在遇到问题的时候,我也跟你们一样,首先是上网查询为什么运行不了呢?明明我安装了之后里面有Calibre的,我当时也是这样的疑惑,一点Calibre运行LVS的时候,一片空白,然后就出现了license的错误,后来点点点,看看看,搜搜搜,最终解决了这个问题。虚拟机是VMware16版本,cadence617,Calibre是2015版本。旨在记录遇到的实际问题。

yytu231的博客 1万+

ExtJS布局Layout

所谓布局就是指容器组件中子元素的分布、排列组合方式。Ext 的所有容器组件都支持而局操作,每一个容器都会有一个对应的布局,布局负责管理容器组件中子元素的排列、组合及渲染方式等。ExtJS2.0 主要包含十种布局,常用的布局有border、column、fit、form、card、tabel等布局,下面我们分别对这几种布局作简单的介绍。ExtJS 的布局基类为Ext.layo

jellen129的专栏 2270

innovus实战攻略 | 用setUsefulSkewMode解锁时序优化的“隐藏技能”!

就像时序优化的“瑞士军刀”,参数虽多,但掌握了分类逻辑后,用起来其实很简单!如果你有更绝的用法,欢迎在评论区分享,大家一起卷起来!简单来说,它就是时序优化的“乾坤大挪移”。通过调整触发器的时钟到达时间,把关键路径的建立时间“借”给非关键路径,从而实现全局时序收敛。别急,这个命令就是你的“时序救星”!(工具最多只能借1.2ns的裕量,防止“借过头”导致新问题!这个参数能帮你兜底!(对关键路径“下死手”,确保优化到位!(设置上限,给工具套上“紧箍咒”!(直接跳过边界,避免优化反噬!(全局管理,防止“借过头”!

weixin_50820814的博客 1373

ExtJs layout 布局

本篇讲解Ext另一个重要的概念:布局。一般的容器类控件都是通过配置项items添加子控件的,这些子控件相对于父控件怎么定位呢,这里就要用到布局。某些容器类控件,它本身默认就集成了一种布局方式,例如比较典型的是:Ext.container.Viewport 布局控件,它其实就是一个border布局的容器,还有Ext.form.Panel、Ext.tab.Panel等。本节我们系统的分析各种布局方式。

yy19900811的专栏 664

复现论文《大规模风电场电磁暂态高效建模仿真方法》

本文提出了一种针对大规模风电场电磁暂态(EMT)仿真的高效建模方法。通过三种关键技术实现仿真加速:(1)永磁直驱风电机组一体化等效建模,采用节点导纳矩阵降维将25节点机组简化为4端子电路,仿真速度提升1-3个数量级;(2)基于戴维南/诺顿等效和OpenMP并行计算的风电场整体建模,通过串并联叠加实现节点收缩,30台机组仿真加速近万倍;(3)受控源映射解耦方法提高故障仿真灵活性。复现代码展示了核心算法实现,包括导纳矩阵Schur补降维、多进程并行计算框架以及受控源解耦方法。

huanghm88的专栏 286

国密GmSSL v2版本命令行方式生成国密sm2私钥、公钥、签名和验证签名

GmSSL是国密算法的工具库(主要包含SM2、SM3、SM4和国密SSL证书生成等功能),项目本身是OpenSSL的分支,但是截至文章发布为止,OpenSSL主分支的国密算法并不完善,目前并不支持签名和解签,所以国密算法这块还是需要使用GmSSL工具库。网上现在并没有v2版本的GmSSL可用的命令行文章,本章用于记录这些命令。本文原创自csdn博客,其他网站看到这篇文章都是盗,版,爬。虫。网站,支持原创,远离盗版。

eguid音视频方向博客,分享经过实践检验的硬核音视频技术。FFmpeg、openCV和JavaCV音视频和图像处理系列教程发布十周年,众多开发者的严格验证。欢迎关注,一起交流探索学习最新音视频和图像处理技术 4620

Extjs4布局layout

1.Layouts   1)Ext.layout.container.Border       layout : 'border' 表示我们使用了Border布局,这种布局方式称为边界布局,它将页面分隔成为:west,east,south,north,center这五个部分,我们在items里面使用region参数为它组织定义具体的位置。      north和south部分只能设置高

Kevinzhangfei的专栏 3368

SAP-ABAP:ABAP 开发基础概念入门:写给刚踏入 SAP 开发世界的新人

本文介绍了 ABAP 开发语言的基础概念,帮助 SAP 开发新人快速入门。主要内容包括: ABAP 的发展历程与核心优势 - 作为 SAP 平台的专属语言,ABAP 在企业级应用开发中具有深度集成、数据处理高效和长期稳定的特点 ABAP 开发环境概览 - 介绍了 SE38、SE80 等关键事务码,以及 ABAP 工作台的核心组件和开发权限管理 基础语法入门 - 重点讲解了 ABAP 特有的数据类型体系(特别是结构体和内表),并通过 Hello World 示例展示程序基本结构 文章通过对比 ABAP 与 J

baidu_35680696的博客 521

ExtJs4 layout 布局

原址:ExtJs4 笔记(14) layout 布局 本篇讲解Ext另一个重要的概念:布局。一般的容器类控件都是通过配置项items添加子控件的,这些子控件相对于父控件怎么定位呢,这里就要用到布局。某些容器类控件,它本身默认就集成了一种布局方式,例如比较典型的是:Ext.container.Viewport 布局控件,它其实就是一个border布局的容器,还有Ext.form.Panel

luckypeng的专栏 1563

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

ssm框架搭建

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

ExtJs layout的七中布局

一、Border布局__边界布局

761

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

extjs 布局 layout---Table布局

Table 布局由类Ext.layout.TableLayout 定义.称为table,该布局负责把容器中的子元素按照类似普通html标签 (除了上述讲的这几种布局以外,还有fit 布局,form布局,accordion布局,card布局) var panel4 = new Ext.Panel({ renderTo:Ext.getBody(), title:'容器组件', heigh

u011123176的专栏 4379

深度学习工具包 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'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('DeepLearnToolbox'));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('state',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'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',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 = 'sigm';%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, 'Too big error');```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('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';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)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';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, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% 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'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 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, 'Too big error');```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('state',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, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',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, 'Too big error');%% ex3 neural net with dropoutrand('state',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, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % 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, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % 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, 'Too big error');%% 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('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % 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, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

ExtJS中layout的12种布局风格

extjs的容器组件都可以设置它的显示风格,它的有效值有 absolute, accordion, anchor, border, card, column, fit, form and table.  一共9种。另外几种见:  http://www.sencha.com/deploy/dev/examples/layout-browser/layout-browser.html  里面有详细的例...

weixin_41233524的博客 314

Extjs中布局layout的9种样式风格总结

Extjs的容器组件都可以设置它的显示风格,它的有效值有:       absolute, accordion, anchor, border, card, column, fit, form and table. 一共9种。       简单总结一下,帮助记忆。

My Coding World 858

ExtJs4 笔记之 layout 布局

本篇讲解Ext另一个重要的概念:布局。一般的容器类控件都是通过配置项items添加子控件的,这些子控件相对于父控件怎么定位呢,这里就要用到布局。 某些容器类控件,它本身默认就集成了一种布局方式,例如比较典型的是:Ext.container.Viewport 布局控件,它其实就是一个border布局的容器,还有Ext.form.Panel、Ext.tab.Panel等。本节我们系统的分析各种布局方式

412

Extjs中面板布局的应用 Extjs Layout

目标:       介绍Panel布局的各种类       Panel布局类在VS中的介绍 内容:       Panel布局类有10种:容器布局,自适应布局,折叠布局,卡片式布局,锚点布局,绝对位置布局,表单布局,列布局,表格布局,边框布局       1,Ext.layout.ContainerLayout 容器布局       提供容器作为布局的基础逻辑,通常会被扩展而不通过ne...

weixin_34284188的博客 145

Extjs4 布局 layout 详解

1.Layouts   1)Ext.layout.container.Border       layout : 'border' 表示我们使用了Border布局,这种布局方式称为边界布局,它将页面分隔成为:west,east,south,north,center这五个部分,我们在items里面使用region参数为它组织定义具体的位置。      north和south部分只能设置高

baiwofcxz的专栏 595

extjs的layout布局

一、常用布局(1)ContainerLayout:默认布局方式,其他布局继承该类进行扩展功能。显示:将内部组件以垂直方式叠加。如下所示:组件一.....组件二.....(2)FormLayout:产生类似表单的外观。显示:将内部组件以垂直方式叠加。如上所示:(3)ColumnLayout:将组件以水平方式放置。如下所示:组件一[第一列]    组件二[第二列]    组件三[第三列](4)Bord...

cc 476

【ExtJS】 布局Layout

  布局用于定义容器如何组织内部子元素和控制子元素的大小。   ExtJS中有两种类型的布局:Container容器类布局与Component组件类布局。   Containter容器类布局:负责容器内容Extjs元素和调整Extjs元素的大小。     包括:Border布局、Box布局、Fit布局等等。   Component组件类布局:负责组织组件的HTML元素。     包括...

weixin_30889885的博客 232

Extjs layout 布局

转载:http://www.cnblogs.com/lipan/archive/2011/12/27/2302719.html   一般的容器类控件都是通过配置项items来添加子控件,那么如何定位子控件和父控件的布局,某些容器类控件,本身就继承了布局方式,如Ext.container.Viewport本身是 一个border布局,有如Ext.form.Panel、Ext.tab.Panel等

qq_30184931的博客 346

Extjs4 layout布局

本篇讲解Ext另一个重要的概念:布局。一般的容器类控件都是通过配置项items添加子控件的,这些子控件相对于父控件怎么定位呢,这里就要用到布局。某些容器类控件,它本身默认就集成了一种布局方式,例如比较典型的是:Ext.container.Viewport 布局控件,它其实就是一个border布局的容器,还有Ext.form.Panel、Ext.tab.Panel等。本节我们系统的分析各种布局方式。

SERLIN 758
上一篇: java 文件读取
下一篇: ExtJS图片上传预览
紫眸少年丶
博客等级 码龄17年 73粉丝 37原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值