three way of waterfall flow

视觉特征-自监督-掩码特征预测【2024-11】:D-JEPA·T2I(通过下一词元预测实现高分辨率图像合成)【相对于D-JEPA的优化:文本条件、流匹配损失、VoPE】 近年来,自回归模型在类别条件图像生成方面展现了卓越的性能。然而,将下一词元预测应用于高分辨率文本到图像生成仍未得到充分探索。在本文中,我们提出了基于连续词元的自回归模型D-JEPA·T2I,该模型在架构和训练策略上均进行了创新,能够在高达4K的任意分辨率下生成高质量、照片级真实感的图像。在架构方面,我们采用去噪联合嵌入预测架构(D-JEPA),同时利用多模态视觉Transformer有效融合文本和视觉特征。此外,我们引入流匹配损失以及所提出的视觉旋转位置编码(VoPE),以实现连续分辨率学习。 阅读详情

First the simple way , use css3 colum-width:

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>


    <style>

        ul{
            column-width: 250px;
        }

        ul>li{
            display: inline-block;
            box-shadow: 10px 10px 10px 10px gray;
            background: red;
            width: 100%;
            height: 300px;
            text-decoration: none;
            margin: 10px 0;
        }

        ul>li:nth-of-type(1){
            height: 100px;
        }

        ul>li:nth-of-type(2){
            height: 50px;
        }

        ul>li:nth-of-type(3){
            height: 80px;
        }


        ul>li:nth-of-type(4){
            height: 120px;
        }


        ul>li:nth-of-type(5){
            height: 180px;
        }

        ul>li:nth-of-type(6){
            height: 200px;
        }

        ul>li:nth-of-type(7){
            height: 111px;
        }


    </style>
</head>
<body>
<ul>
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
</ul>
</body>
</html>

这里写图片描述

note : you need add display:inline-block otherwise some block will to next colum.

the second way ,by javascript

step:

    .1 dynatic create box and img 
    .2 cycle get the minimum height and then put the next to the below of the most minimum  use position absolute method
    .3 when scroll to half height of screen load other more 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>瀑布流首页</title>

    <style>

        *{
            /*去除边距*/
            margin:0;
            padding: 0;
            /*html性能优化:虚拟dom,如果一个html标签没有设置css样式,就是虚拟的,
             所以无论设置多少层div都对性能没有影响*/
        }
        #main{
            height: 2000px;
            /*定位*/
            position: relative;
        }
        .box{
            /*内边距*/
            padding:15px 0 0 15px ;
            float: left;
        }
        .pic{
            /*边框*/
            border:1px solid #dddddd;
        }
        .pic img{
            width: 105px;
        }

    </style>
</head>
<body>
<!--父盒子-->
<div id="main">
    <!--单个盒子-->
    <div class="box">
        <!--图片盒子-->
        <div class="pic">
            ![](images/1.jpg)
        </div>
    </div>
    <!--单个盒子标签复制20次...图片名字改改...-->
</div>
<!--jQuery方式需要引入jQuery库,JS方式与CSS方式都要注释掉-->
<!--引入JS,CSS方式注释掉-->

<script>


    /**
     * Created by Mac on 2017/1/7.
     */
    function $(id) {
        //判断id的类型
        return typeof id === 'string'?document.getElementById(id):id;
    }

    //当网页加载完毕
    window.onload = function () {
        //瀑布流布局 保证传的参数能够找到父盒子
        waterFall('main','box');

        //滚动加载盒子
        window.onscroll = function (){
            //判断是否加载
            if (checkWillLoad())
            {
                //创造假数据
                var data = {'dataImg':[{'img':'22.jpg'},{'img':'22.jpg'},{'img':'22.jpg'},{'img':'22.jpg'},{'img':'22.jpg'},{'img':'22.jpg'}]};
                //加载数据
                for(var i=0; i<data.dataImg.length; i++)
                {
                    //创建最外面的盒子
                    var newBox = document.createElement('div');
                    newBox.className = 'box';
                    $('main').appendChild(newBox);
                    //创建单个盒子
                    var newPic = document.createElement('div');
                    newPic.className = 'pic';
                    newBox.appendChild(newPic);
                    //创建img
                    var newImg = document.createElement('img');
                    newImg.src = 'images/' + data.dataImg[i].img;
                    newPic.appendChild(newImg);
                }
                //把刚创建的盒子瀑布流布局
                waterFall('main','box');
            }
        }
    }

    //实现瀑布流布局
    //规则:从第二行开始的图片,总是拼接在上一行高度最矮的图片后面
    function  waterFall(parent,box) {
        //父盒子居中
        //通过父盒子拿到所有的子盒子
        var allBox = $(parent).getElementsByClassName(box);
        //求出盒子的宽度
        var boxWidth = allBox[0].offsetWidth;
        //求出浏览器的宽度(包括边框的宽高)
        var screenWidtn = document.body.offsetWidth;
        //求出列数 //取整函数取整
        var cols = Math.floor( screenWidtn/boxWidth);
        //父标签居中
        //先求出父标签宽度
        $(parent).style.width = boxWidth * cols + 'px';
        //居中
        $(parent).style.margin = '0 auto';

        //子盒子定位
        //创建一个高度数组,存所有的高度
        var heightArr = [];
        //遍历
        for(var i = 0; i < allBox.length ;i++)
        {
            //求出每个盒子的高度
            var boxHeight = allBox[i].offsetHeight;
            //第一行的盒子不需要重新定位//每一行的盒子数与列数相同
            if(i<cols)
            {
                //添加第一行所有盒子高度
                heightArr.push(boxHeight);
            }
            else//剩下的盒子都需要瀑布流布局
            {
                //求出最矮的盒子高度
                var minBoxHeight = Math.min.apply(this,heightArr);
                //求出最矮盒子对应的索引
                var minBoxIndex = getMinBoxIndex(minBoxHeight,heightArr);
                //盒子瀑布流定位  顶部间距就是最矮盒子的高度
                allBox[i].style.position = 'absolute';
                allBox[i].style.top = minBoxHeight + 'px';
                allBox[i].style.left = minBoxIndex * boxWidth +'px';
                //关键:更新数组最矮高度,使下一个图片在高度数组中总是找最矮高度的图片下面拼接
                heightArr[minBoxIndex] += boxHeight;
            }
        }
    }

    //求出最矮盒子对应的索引函数
    function getMinBoxIndex(val,arr) {
        for(var i in arr)
        {
            if(val == arr[i])
            {
                return i;
            }
        }
    }

    //加载更多规则:当浏览器最下方到达图片的高度一半时让其刷新出来
    //判断是否符合加载条件
    function checkWillLoad() {
        //取出所有盒子
        var allBox = $('main').getElementsByClassName('box');
        //取出最后一个盒子
        var lastBox = allBox[allBox.length - 1];
        //求出最后一个盒子高度的一半 + 内容与浏览器头部的偏离位置
        var lastBoxDis = lastBox.offsetHeight * 0.5 + lastBox.offsetTop;
        //求出浏览器的高度
        // 注意:JS代码存在浏览器兼容问题 一般分标准模式(按屏幕算document.body.offsetHeight)和混杂模式(按所有内容算)
        var screenHeight =  document.documentElement.clientHeight;
        //页面偏离屏幕的高度
        var scrollTopHeight = document.body.scrollTop;
        //判断
        return lastBoxDis <= screenHeight + scrollTopHeight;
    }
</script>

</body>
</html>

这里写图片描述

.3 Third way is same to second but use jq to write

// document.write("<script src='jquery-3.1.1.min.js'></script>");
//当页面加载完毕
$(window).on('load',function () {
    //1.实现瀑布流布局
    waterFall();

    //2.滚动加载
    $(window).on('scroll',function () {
        //判断是否加载
        if (checkWillLoad())
        {
            ////创造假数据
            var data = {'dataImg':[{'img':'23.jpg'},{'img':'24.jpg'},{'img':'25.jpg'},{'img':'26.jpg'},{'img':'27.jpg'},{'img':'28.jpg'}]};
            //遍历创建盒子
            $.each(data.dataImg,function (index,value)
                   {
                       //创建一个div标签 设置它的类为'box' 添加到'main'里面去
                       var newBox = $('<div>').addClass('box').appendTo($('#main'));
                       var newPic = $('<div>').addClass('pic').appendTo($(newBox));
                       //创建img  取出遍历的对象value的img属性对应的值
                       $('<img>').attr('src','images/'+$(value).attr('img')).appendTo($(newPic));
                   })
            //1.实现瀑布流布局
            waterFall();
        }
    });
});

//实现瀑布流布局
function waterFall () {
    //拿到所有的盒子
    var allBox = $('#main > .box');
    //取出其中一个盒子的宽度
    var boxWidth = $(allBox).eq(0).outerWidth();
    //取出屏幕的高度
    var screenWidth = $(window).width();
    //求出列数 //取整函数取整
    var cols = Math.floor( screenWidth/boxWidth);
    //父标签居中
    $('#main').css({
        'width':cols * boxWidth + 'px',
        'margin':'0 auto'
    });
    //对子盒子定位
    var heightArr = [];
    //遍历
    $.each(allBox,function (index,value) {
        //取出单独盒子的高度
        var boxHeight = $(value).outerHeight();
        //判断是否第一行
        if(index < cols)
        {
            heightArr[index] = boxHeight;
        }
        else  //剩余的盒子要瀑布流布局
        {
            //求出最矮的盒子高度
            var minBoxHeight = Math.min.apply(null,heightArr);
            //取出最矮高度对应的索引  封装了js的这个方法
            var minBoxIndex = $.inArray(minBoxHeight,heightArr);
            //定位
            $(value).css({
                'position':'absolute',
                'top':minBoxHeight + 'px',
                'left':minBoxIndex * boxWidth + 'px'
            });
            //更新数组中最矮的高度
            heightArr[minBoxIndex] += boxHeight;
        }
    })

}

//判断是否符合加载条件
function checkWillLoad() {
    //直接取出最后一个盒子
    var lastBox = $('#main > div').last();
    //取出最后一个盒子高度的一半 + 头部偏离的位置
    var lastBoxDis = $(lastBox).outerHeight() + $(lastBox).offset().top;
    //求出浏览器的高度
    var clientHeight = $(window).height();
    //求出页面偏离浏览器高度
    var scrollTopHeight = $(window).scrollTop();
    //比较返回
    return lastBoxDis <= clientHeight + scrollTopHeight;

}
The effect is same to above.

refer:http://www.jianshu.com/p/0a9b27e7da36

        thanks for reading
大型国有银行应用系统全链路性能劣化智能根因定位与自愈Agent平台详细设计方案.docx 立即下载

相关推荐

【深度学习开发环境配置】基于PyTorch的计算机视觉项目依赖管理:requirements.txt文件解析与版本控制方案

内容概要:该文件为一个Python项目的依赖包配置文件(requirements.txt),列出了项目运行所需的软件包及其最低版本要求。主要包括深度学习框架PyTorch及其视觉扩展 torchvision、科学计算库 numpy 和 scipy、数据处理工具 pandas、机器学习库 scikit-learn、图像处理库 opencv-python 和 Pillow,以及数据可视化工具 matplotlib 和 seaborn 等。该配置确保项目在不同环境中具备一致的运行条件。; 适合人群:从事深度学习、计算机视觉或数据科学相关工作的开发者与研究人员,熟悉Python环境管理的技术人员; 使用场景及目标:①用于搭建项目开发环境,确保依赖一致性;②支持模型训练、图像处理、数据分析等任务的环境准备;③便于项目共享与部署,降低环境配置成本; 阅读建议:在实际使用时,建议通过 pip install -r requirements.txt 安装依赖,并根据具体硬件环境适当调整版本兼容性,尤其注意 PyTorch 与 CUDA 版本的匹配。

用vue-cli构建了项目之后在webstorm开发,用npm run dev跑本地服务,经常修改之后在浏览器刷新没反应,偶尔才会有刷新,需要重新跑一遍npm run dev才会更新,这是怎么回事呢?

webstorm保存的时候会先保存到旧时文件中,其实并没有真正保存,要在setting->stystem settings下的“use save write”去掉

java_goodstudy的博客 1万+

顶刊复现改进优化反演控制的水面舰艇自适应跟踪控制程序

内容概要:本文档介绍了名为“【顶刊复现】改进优化反演控制的水面舰艇自适应跟踪控制程序”的Matlab仿真资源,聚焦于水面舰艇与无人船在复杂海洋环境下的高精度路径跟踪与运动控制问题。该资源基于先进的非线性控制理论,如反演控制(Backstepping)、李雅普诺夫稳定性理论和自适应控制方法,构建了具备强鲁棒性和抗干扰能力的控制器,能够有效应对模型不确定性、外部扰动及环境变化。文档还列举了多项相关Matlab仿真项目,涵盖多智能体协同控制、事件触发通信、模糊PID控制、模型预测控制(NMPC)、滑模控制等多种前沿控制策略,充分体现了其在智能船舶控制、海洋工程自动化和无人系统领域的高水平学术价值与实际应用潜力。; 适合人群:具备自动控制理论基础和Matlab编程能力的科研人员、控制科学与工程及相关专业的研究生,以及从事无人船、水面航行器、水下机器人等智能航海装备控制系统开发的工程技术人员。; 使用场景及目标:① 复现顶级期刊(如SCI一区)中关于水面舰艇或无人船的先进控制算法,支撑高水平学术论文的研究与撰写;② 作为高校课程或科研实验的教学案例,开展非线性系统控制、自适应控制、轨迹跟踪等方向的教学与实践;③ 为智能船舶、海上无人集群系统等实际工程项目提供算法验证、性能测试与仿真优化的技术平台。; 阅读建议:此资源以Matlab代码为核心载体,建议使用者结合现代控制理论教材与原始参考文献,深入理解反演控制与自适应机制的设计逻辑与数学推导,并通过修改参数、调整初始条件和扰动设置等方式调试仿真程序,全面掌握算法的实现细节与性能边界,实现从理论分析到仿真实践的完整闭环。

解决在angular 中swiper 不能滑动问题

Swiper是目前较为流行的移动端触摸滑动插件,因为其简单好用易上手,受到很多前端开发者的欢迎。 > 首先提供一种方式 : 监听 ng-repeat 渲染事件 当组件渲染完成时候 初始化 swiper 即可 下面是从网上看到的 今天在使用Swiper的时候遇到这个问题: 使用angularjs动态循环生成swiper-slide类,在swiper-wrapper里生成6个以上的滑

java_goodstudy的博客 6643

图形学基础|基于SDF的卡通阴影图

图形学基础|基于SDF的卡通阴影图 文章目录图形学基础|基于SDF的卡通阴影图一、前言二、SDF(Signed Distance Field)三、阴影图生成3.1 SDF生成3.2 插值参考博文 一、前言 回顾之前做的卡通渲染,角色面部阴影是靠一张阴影贴图实现的。 为了更好地控制角色的脸部阴影,通过计算脸部朝向与光照方向的夹角和一张单色的FaceMap来判断。 FaceMap的每个像素表示:该像素判断为阴影时候需要达到的夹角。 例如: 当方向光正对角色的时候,夹角为0°,对应的值为0,此时,FaceMap

【黑键】 1万+

强化学习赋能宇树机器狗:Isaac Gym与MuJoCo仿真训练全解析

本文详细解析了如何利用Isaac Gym和MuJoCo两大仿真平台为宇树机器狗构建强化学习训练管道。内容涵盖环境配置、模型导入、PPO算法框架设计、奖励函数构建以及从仿真到实机的策略迁移技巧,为开发者提供了一套完整的宇树狗仿真训练实践方案。

zeta9的博客 631

用html5,nodeJs开发桌面应用程序

原文摘自: http://www.webhek.com/html5-native-desktop-app/ HTML5让Web开发人员用纯HTML技术开发富客户端互联网应用或者甚至本地桌面应用成为了可能。HTML5可以将任何普通网站转变成Web应用。HTML5 web 应用不仅具有在桌面浏览器应用中的优势,同时在智能手机和平板中也是开发利器。 在手机端,有一个非常棒的工具叫做PhoneGap,

java_goodstudy的博客 6285

AI量化交易工作台Vibe-Trading:用自然语言驱动策略回测与多智能体研究

量化交易通过数学模型和计算机程序执行投资决策,其核心在于将市场规律转化为可验证的策略。传统量化开发涉及数据获取、策略编写、回测验证等复杂工程,对非编程背景的从业者构成较高门槛。随着大语言模型技术的发展,自然语言交互正成为降低技术使用难度的关键。Vibe-Trading项目正是这一趋势的实践,它将金融工程任务封装为可调用的工具与技能,允许用户通过自然语言指令直接驱动策略回测、因子研究和投资组合分析。其技术价值在于构建了一个模块化的AI Agent框架,通过ReAct推理框架协调多个专项技能,并创新性地引入多智

weixin_28695161的博客 1573

html5调用本地摄像头

THE CURRENT STATE OF HTML5 FORMS Wufoo The accept Attribute accept="image/*"> (images only) Live Demo Firefox 3.6+ Safari 7+ Safari Mobile 5+ Chrome 17

java_goodstudy的博客 6003

浅析ArcGis中的软件——ArcMap、ArcScene、 ArcGlobe、ArcCatalog

ArcMap:是集空间数据显示、矢量数据编辑、冲突数据检查(拓扑检查)、查询检索(地理编码)、统计(字段属性表)、报表生成、空间分析(ArcGIS Spatial Analyst)和高级制图(制图表达)等众多功能干一体的桌面应用平台软件。而且提供所见即所得的符号编辑器,令用户可以随心所欲地生成任意复杂的点、线、面符号。所支持的空间数据格式包括Arclnfo coverages、ESRI shapefiles、ArcSDE lavers、DXF、DWG、DGN、常见的图像格式、GRIDs、TINs等。

lxlmycsdnfree的博客 6580

K型热电偶负电压采集难题?3种运放电路设计方案对比(含Multisim仿真)

本文针对K型热电偶在低温测量中产生的负电压采集难题,详细对比了三种运放电路设计方案,包括双电源运放反相放大、单电源仪表放大器和差分放大电路,并结合Multisim仿真数据分析了各方案的性能差异。文章还提供了PCB布局和抗干扰设计的实战技巧,帮助工程师解决热电偶信号采集中的核心挑战。

postgres8guard的博客 1030

纯css实现 页面加载动画

http://www.cnblogs.com/lhb25/p/loading-spinners-animated-with-css3.html

java_goodstudy的博客 4388

Multisim实战:5分钟搞定一阶RC电路仿真(附示波器波形分析技巧)

本文通过Multisim软件,详细演示了如何快速搭建一阶RC电路并进行仿真分析。文章提供了从元件选取、电路连接、虚拟示波器设置到波形观测的完整流程,并重点分享了测量时间常数、区分电路响应类型等核心分析技巧,帮助电子工程初学者和爱好者高效掌握电路仿真与分析方法。

weixin_29175469的博客 191

webpack gulp 实现完整前端工程化

作者:陈学家 链接:https://zhuanlan.zhihu.com/p/21312474 来源:知乎 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。 在前面的两个小节中已经完整的讲了 webpack 和 gulp 相关的内容,本小节中将会结合二者构建一个完整的前端工作流,内容目录为: 前端工程结构和目标 前端工程目录结构 gulp cl

java_goodstudy的博客 4024

2024年数字IC秋招-华为机试-数字芯片-实习笔试题

笔试题目:40个选择题A.综合时不同文件列表内的宏定义仅在本列表生效B.宏定义会覆盖,不需要单独undefC.仿真时出现宏定义冲突以最后一次值为准D.宏定义最好在各文件中随用随定义A.4/9B.4/6C.01D.0/6。

qq_42135020的博客 2895

YOLOv5入门实践(2)——手把手教你利用labelimg标注数据集

YOLOv5入门实践第2步,手把手教你使用labelimg标注数据集

路人贾的博客 1万+

前端上传图片oss

https://segmentfault.com/a/1190000006718963

java_goodstudy的博客 3405

深度学习工具包 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")

nodejs module.export require 原理分析

大部分实现在module.js中,按照顺序来看: 首先调用require('xx')的时候内部调用了Module._load(path, parent) : Module.prototype.require = function(path) { assert(path, 'missing path'); assert(util.isString(path), 'path must be a

java_goodstudy的博客 3360

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

AngularJS 报 ngModel:numfmt

AngularJS 报 ngModel:numfmt angularJS 前台报错  Error: ngModel:numfmt Model is not of type `number` 错误:ngModel:numfmt模型的类型是`number` 就是说你input中 model的参数可能是text  然后你在input的typ

java_goodstudy的博客 3042

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

前端amd,cmd,commonJs,规范

首先说一下前端常用的打包工具 webpack, requierJs,grunt  其中,webpack 为了方便同时支持 amd 与 cmd 规范, NodeJs遵循cmd 规范, 而requireJs 遵循amd 规范, 而浏览器本身是不支持 cmd(同步加载js,加载过程中会造成渲染阻塞,假死现象), 当然amd 是可以得到支持的, 而在webpack 进行js,合并 压缩 隔离之后,commo

java_goodstudy的博客 2839

Vue Lazy Loading Routes

When building apps with a bundler, the JavaScript bundle can become quite large, and thus affect the page load time. It would be more efficient if we can split each route’s components into a separate c

java_goodstudy的博客 2653

js混淆压缩加密分析

请看原文

java_goodstudy的博客 2178

vue-loader + Webpack 环境搭建

https://segmentfault.com/a/1190000004060034

java_goodstudy的博客 1794

html 5 模仿 form 提交file 文件之FormData

使用xhtr 2 可以实现前端提交 无刷新提交form表单 api 参考mdn : https://developer.mozilla.org/zh-CN/docs/Web/API/FormData/%E5%88%A0%E9%99%A4使用ajax 请求时 注意 $.ajax({ url : this.baseUrl+'updateHead',

java_goodstudy的博客 1747

yarn

install refer : http://www.jackpu.com/yarn-facebook-kai-yuan-de-bao-guan-li-gong-ju/ yarn documention : https://yarnpkg.com/en/ yarn compare npm :https://yarnpkg.com/en/docs/migrating-from-npm:yarn

java_goodstudy的博客 1446

格斗对决v4.5

《格斗对决v4.4》是一款基于HTML5的2D格斗游戏,支持玩家与AI对战。游戏提供多种地图、难度选择及五大特色大招(如升龙拳、虚化、瞬移等),结合能量系统与连击机制。玩家可操控角色进行移动、攻击、防御与技能释放,战斗中包含道具拾取、时间减缓特效与多敌人协作机制。画面风格鲜明,操作流畅,强调策略与反应,适合休闲与竞技场景。

qq_54357370的博客 482
上一篇: nodejs koa framework overview
下一篇: js object.create()、Object.defineproperty()、,Object.keys()...for..in,for..each
一朵红杏
博客等级 码龄12年 51粉丝 282原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值
⌂ 换网址