DataTable源代码分析(一)

c#拷贝datatable行_如何从一个DataTable中复制数据行到另一个DataTable中 ===前提:我们已经有一个DataTable的数据表 现在需要的只是其中的一行数据===比如说下面这段代码在一个方法里 返回的就是一个DataTable!sqlCon=newSqlConnection(strCon);sqlCom=newSqlCommand();sqlCom.Connection=sqlCon;sqlCom.CommandText="select_v";sqlCom.Comman... 阅读详情

 DataTable源代码分析(一)

1.DataTable.js

      DataTable.js是DT主文件。在这个文件里会通过require引用同目录下ext\js\core\api中的js文件。以下划线开头的函数方法基本上

都是全局变量,这些方法都在api和core两个文件夹中。

 // source_code_analysis

/*!
 * @summary     DataTables
 * @description Paginate, search and sort HTML tables
 * @version     1.10.0-dev
 * @file        jquery.dataTables.js
 * @author      Allan Jardine (www.sprymedia.co.uk)
 * @contact     www.sprymedia.co.uk/contact
 *
 * @copyright Copyright 2008-2013 Allan Jardine.
 *//该源文件是免费软件。在以下许可证中可用:GPL V2、BSD、MIT
 * This source file is free software, available under the following licenses:
 *   GPL v2 license        - http://datatables.net/license_gpl2
 *   BSD (3 point) license - http://datatables.net/license_bsd
 *   MIT license           - http://datatables.net/license_mit
 *
 * This source file is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details.
 *
 * For details please refer to: http://www.datatables.net
 */


/*jslint evil: true, undef: true, browser: true */  jslint是一个javascript代码验证工具。
/*globals  //全局变量$,require,jQuery,define,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnNodeToColumnIndex,_fnInfoMacros,_fnBrowserDetect,_fnGetColumns,_fnHungarianMap,_fnCamelToHungarian,_fnBuildAjax,_fnAjaxDataSrc*/


(/** @lends <global> */function( window, document, undefined ) {    //代码执行入口


(function( factory ) {
"use strict";    //引用严格模式


// Define as an AMD module if possible
if ( typeof define === 'function' && define.amd )
{
define( ['jquery'], factory );
}
/* Define using browser globals otherwise
* Prevent multiple instantiations if the script is loaded twice
*/
else if ( jQuery && !jQuery.fn.dataTable )
{
factory( jQuery );
}
}
(/** @lends <global> */function( $ ) {
"use strict";


/**
* DataTables is a plug-in for the jQuery Javascript library. It is a highly
* flexible tool, based upon the foundations of progressive enhancement,
* which will add advanced interaction controls to any HTML table. For a
* full list of features please refer to
* [DataTables.net](href="http://datatables.net).
*
* Note that the `DataTable` object is not a global variable but is aliased
* to `jQuery.fn.DataTable` and `jQuery.fn.dataTable` through which it may
* be  accessed.
          //DT 对象不是一个全局变量,而是以jQuery.fn.DataTable 和  jQuery.fn.dataTable 作为别名来引用。

*


*  @class
*  @param {object} [init={}] Configuration object for DataTables. Options
*    are defined by {@link DataTable.defaults}
*  @requires jQuery 1.3+
*
*  @example
*    // Basic initialisation
*    $(document).ready( function {
*      $('#example').dataTable();
*    } );
*
*  @example
*    // Initialisation with configuration options - in this case, disable
*    // pagination and sorting.
*    $(document).ready( function {
*      $('#example').dataTable( {      //初始化时的基本属性配置
*        "paginate": false,
*        "sort": false
*      } );
*    } );
*/
var DataTable;

//引用核心文件夹里的文件。core文件夹里主要定义了DT的异步、分列、构造器、过滤、初始化、分页、数据处理、滚动条、排序等方法。
require('core.compat.js');
require('core.columns.js');
require('core.data.js');
require('core.draw.js');
require('core.ajax.js');
require('core.filter.js');
require('core.info.js');
require('core.init.js');
require('core.length.js');
require('core.page.js');
require('core.processing.js');
require('core.scrolling.js');
require('core.sizing.js');
require('core.sort.js');
require('core.state.js');
require('core.support.js');


DataTable = function( oInit )
{
require('api.methods.js');
require('api.internal.js');

var _that = this;
this.each(function() {
require('core.constructor.js');
} );
_that = null;
return this;
};


require('api.core.js');
require('api.table.js');
require('api.draw.js');
require('api.page.js');
require('api.ajax.js');
require('api.order.js');
require('api._selectors.js');
require('api.rows.js');
require('api.columns.js');
require('api.static.js');


/**
* Version string for plug-ins to check compatibility. Allowed format is
* `a.b.c-d` where: a:int, b:int, c:int, d:string(dev|beta|alpha). `d` is used
* only for non-release builds. See http://semver.org/ for more information.
*  @member
*  @type string
*  @default Version number
*/
DataTable.version = "1.10.0-dev";

       //私有数据存储,包含表中给定页中被创建的对象设置。
/**
* Private data store, containing all of the settings objects that are
* created for the tables on a given page.


*//注意:DT 被设置对象 主要通过名称 jQuery.fn.dataTableExt或者jQuery.fn.dataTable.settings来引用和操作。
* Note that the `DataTable.settings` object is aliased to
* `jQuery.fn.dataTableExt` through which it may be accessed and
* manipulated, or `jQuery.fn.dataTable.settings`.
*  @member
*  @type array
*  @default []
*  @private
*/
DataTable.settings = [];


/**
* Object models container, for the various models that DataTables has
* available to it. These models define the objects that are used to hold
* the active state and configuration of the table.
*  @namespace
*/
DataTable.models = {};
require('model.ext.js');
require('model.search.js');
require('model.row.js');
require('model.column.js');
require('model.defaults.js');
require('model.defaults.columns.js');
require('model.settings.js');


/**
* Extension object for DataTables that is used to provide all extension
* options.
*
* Note that the `DataTable.ext` object is available through
* `jQuery.fn.dataTable.ext` where it may be accessed and manipulated. It is
* also aliased to `jQuery.fn.dataTableExt` for historic reasons.
*  @namespace
*  @extends DataTable.models.ext
*/
DataTable.ext = $.extend( true, {}, DataTable.models.ext );
require('ext.classes.js');
require('ext.paging.js');
require('ext.sorting.js');
require('ext.types.js');


// jQuery aliases
$.fn.dataTable = DataTable;
$.fn.DataTable = function ( opts ) {
return $(this).dataTable( opts ).api();
};
$.fn.dataTableSettings = DataTable.settings;
$.fn.dataTableExt = DataTable.ext;


        //以下是DataTable事件信息文档。

// Information about events fired by DataTables - for documentation.
/**
* Draw event, fired whenever the table is redrawn on the page, at the same
* point as fnDrawCallback. This may be useful for binding events or
* performing calculations when the table is altered at all.
*  @name DataTable#draw
*  @event
*  @param {event} e jQuery event object
*  @param {object} o DataTables settings object {@link DataTable.models.oSettings}
*/

          //过滤事件
/**
* Filter event, fired when the filtering applied to the table (using the
* build in global global filter, or column filters) is altered.
*  @name DataTable#filter
*  @event
*  @param {event} e jQuery event object
*  @param {object} o DataTables settings object {@link DataTable.models.oSettings}
*/
         //页面更改事件

/**
* Page change event, fired when the paging of the table is altered.
*  @name DataTable#page
*  @event
*  @param {event} e jQuery event object
*  @param {object} o DataTables settings object {@link DataTable.models.oSettings}
*/

        //排序时间
/**
* Sort event, fired when the sorting applied to the table is altered.
*  @name DataTable#sort
*  @event
*  @param {event} e jQuery event object
*  @param {object} o DataTables settings object {@link DataTable.models.oSettings}
*/
     //DT初始化完成事件

/**
* DataTables initialisation complete event, fired when the table is fully
* drawn, including Ajax data loaded, if Ajax data is required.
*  @name DataTable#init
*  @event
*  @param {event} e jQuery event object
*  @param {object} oSettings DataTables settings object
*  @param {object} json The JSON object request from the server - only
*    present if client-side Ajax sourced data is used</li></ol>
*/
///////状态保存事件

/**
* State save event, fired when the table has changed state a new state save
* is required. This method allows modification of the state saving object
* prior to actually doing the save, including addition or other state
* properties (for plug-ins) or modification of a DataTables core property.
*  @name DataTable#stateSaveParams
*  @event
*  @param {event} e jQuery event object
*  @param {object} oSettings DataTables settings object
*  @param {object} json The state information to be saved
*/

         //状态加载事件
/**
* State load event, fired when the table is loading state from the stored
* data, but prior to the settings object being modified by the saved state
* - allowing modification of the saved state is required or loading of
* state for a plug-in.
*  @name DataTable#stateLoadParams
*  @event
*  @param {event} e jQuery event object
*  @param {object} oSettings DataTables settings object
*  @param {object} json The saved state information
*/
   //状态已加载事件。

/**
* State loaded event, fired when state has been loaded from stored data and
* the settings object has been modified by the loaded data.
*  @name DataTable#stateLoaded
*  @event
*  @param {event} e jQuery event object
*  @param {object} oSettings DataTables settings object
*  @param {object} json The saved state information
*/

       //事件处理
/**
* Processing event, fired when DataTables is doing some kind of processing
* (be it, sort, filter or anything else). Can be used to indicate to the
* end user that there is something happening, or that something has
* finished.
*  @name DataTable#processing
*  @event
*  @param {event} e jQuery event object
*  @param {object} oSettings DataTables settings object
*  @param {boolean} bShow Flag for if DataTables is doing processing or not
*/
    //
//异步请求事件
/**
* Ajax (XHR) event, fired whenever an Ajax request is completed from a
* request to made to the server for new data. This event is called before
* DataTables processed the returned data, so it can also be used to pre-
* process the data returned from the server, if needed.
*
* Note that this trigger is called in `fnServerData`, if you override
* `fnServerData` and which to use this event, you need to trigger it in you
* success function.
*  @name DataTable#xhr
*  @event
*  @param {event} e jQuery event object
*  @param {object} o DataTables settings object {@link DataTable.models.oSettings}
*  @param {object} json JSON returned from the server
*
*  @example
*     // Use a custom property returned from the server in another DOM element
*     $('#table').dataTable().on('xhr', function (settings, json) {
*       $('#status').html( json.status );
*     } );
*
*  @example
*     // Pre-process the data returned from the server
*     $('#table').dataTable().on('xhr', function (settings, json) {
*       for ( var i=0, ien=json.aaData.length ; i<ien ; i++ ) {
*         json.aaData[i].sum = json.aaData[i].one + json.aaData[i].two;
*       }
*       // Note no return - manipulate the data directly in the JSON object.
*     } );
*/
//       销毁事件

/**
* Destroy event, fired when the DataTable is destroyed by calling fnDestroy
* or passing the bDestroy:true parameter in the initialisation object. This
* can be used to remove bound events, added DOM nodes, etc.
*  @name DataTable#destroy
*  @event
*  @param {event} e jQuery event object
*  @param {object} o DataTables settings object {@link DataTable.models.oSettings}
*/


/**
* Page length change event, fired when number of records to show on each
* page (the length) is changed.
*  @name DataTable#length
*  @event
*  @param {event} e jQuery event object
*  @param {object} o DataTables settings object {@link DataTable.models.oSettings}
*  @param {integer} len New length
*/
}));


}(window, document));
//DT的主要方法和函数都在api\core\ext\以及model四个文件夹中。



js-datatable:jQuery插件可通过数据可视化生成动态HTML表https:toni-heittola.github.iojs-datatable js-datatable-具有数据可视化的动态表 js-datatable是一个开放源代码的JQuery插件,用于生成具有数据可视化功能的动态HTML表。 该插件最初是为满足学术数据可视化( )的需要而开发的,并与静态页面生成框架一起使用。 要与Pelican集成,请参见项目。 该插件旨在与一起使用。 动态表处理通过实现,而数据可视化通过。 要查看实际使用的插件,请查看。 详细说明和演示请参阅。 作者 Toni Heittola( ), , 安装说明 要使用插件,需要以下javascript和CSS文件: <script type="text/javascript" src="h 立即下载

相关推荐

Vue 实现华视身份证读卡器功能

在www.downcc.com下载“华视cvr100驱动”安装程序; 华视电子官网有相应的文档说明和程序下载 一、服务安装 选择安装目录: 启动读卡服务: 安装成功会有如图所示: 注意事项: 安装开发包必须使用管理员权限,因为windows服务和读卡器设备驱动程序均需要管理员权限,否则会安装失败。 win10需要修改组策略才有管理员权限。 二、服务的使用 打开浏览器,输入地址http://127.0.0.1:19196/mainpage,回车 点击openDevice: 点.

zyqgt960812的博客 6503

datatable参数和服务端ajax函数配置及说明

上周因为需要使用了datatable,可是网上搜索到的要么就是一点点的参数介绍,要么就是几个回调函数的介绍,极少数有比较全面的,所以把自己用到的总结了一下,这其中涉及到服务端的分页,其实datatable都给我们集成好了,用起来是很方便的,话不多说,如下: 关于datatable使用详解: 1、基本参数配置: 要注意的是,要被dataTable处理的table对象,必须有

shya_的博客 1万+

从零搭建无人机仿真环境:ROS 2与Gazebo Fortress实战指南

本文提供了一份详细的无人机仿真环境搭建实战指南,基于Ubuntu 22.04系统,整合ROS 2 Humble与Gazebo Fortress两大核心工具。通过分步讲解安装、配置及桥接过程,并引入PX4飞控与XTDrone2工具链,帮助开发者快速构建一个稳定、高效的无人机算法开发与测试平台,有效降低真机测试的成本与风险。

water的专栏 430

【DataTable.js】01.DataTable基础应用

本文主要介绍了DataTable.js组件的应用

Do_GH的博客 4578

CST STUDIO SUITE 2023安装

破解工具的Crack文件夹内有一个名为「CST Studio Suite 2022」的文件夹,这也是于CST的安装目录同名的文件夹,直接把它拷贝到CST Studio Suite 2022的同级路径下即可,比如你的CST安装路径为:D:\Program Files\CST Studio Suite 2022,则将Crack目录内的「CST Studio Suite 2022」文件夹复制到 D:\Program Files\ 这个级别的路径下即可。软件百度网盘链接放在文章末尾啦!先不着急启动CST或者激活。

m0_49516223的博客 4127

ThinkPad T14 Gen 2与T14P系列对比

表格您的需求推荐机型日常办公、出差、文档处理、视频会议✅(够用、轻便、便宜)视频剪辑、3D建模、编程编译、AI训练、高色准设计✅(性能强、屏幕好、扩展佳)想要未来 5 年不换机✅T14p预算低于 5000 元✅T14 Gen 2(或考虑 T14 Gen 3/4)T14p 2025 款 ≠ 小改款,而是架构级升级它从“高性能笔记本”进化为“AI 移动工作站”,核心差异在于NPU + Ultra 平台 + 全面屏显 + 超长续航。如果您从事AI 开发、视频创作、工程仿真、多任务编程。

tecoes的博客 2750

DataTable 转换 Json 以及 js读取

数据页面代码 View Code #region 将table转换为json /// <summary> /// 将table转换为json /// </summary> /// <param name="dt"></param> /// <returns></returns> ...

weixin_30352645的博客 364

安卓逆向实战:利用Frida-RPC自动化获取大麦演唱会数据

本文详细介绍了如何利用Frida-RPC技术实现安卓逆向自动化,以获取大麦演唱会数据。通过实战演示,从环境搭建、使用Frida动态分析定位核心签名算法,到封装为可复用的Python脚本,完整解析了自动化数据获取的技术路径与工程化思考。

cheese的博客 978

JQuery DataTables显示行号及连续自动编号

介绍了 JQuery DataTables 四种自动编号的方法,结合官网文档介绍了 JQuery DataTables如何显示行号

shuai_wy的专栏 1万+

Hermes-Agent-完整指南

Hermes Agent 是由 **Nous Research** 开发的一款**自我改进型 AI Agent**,具有内置的学习闭环系统。它的核心理念是"一个与你共同成长的 Agent"。- 能够从经验中创建技能(Skill-Learning Automated),在使用过程中自我改进, 跨会话持久记忆, 深度用户建模

liu_zhiyi的博客 3040

SAP录入总账凭证报错 公司代码未被分配给国家或用于计算程序的国家消息号 FF703

SAP系统报错FF703的解决方案:当公司代码未分配国家或未配置计税程序时,会导致增值税计算失败。处理方法:1)通过OX02检查公司代码国家字段;2)使用OBBG为国家分配计税程序(如TAXCN)。配置步骤:1)SPRO分配公司代码到国家;2)OBBG设置国家对应的计税程序。注意事项:历史数据需清理才能修改国家字段,不同账簿可配置不同计税程序。完成配置后即可正常处理含税凭证。

金牌架构师 559

Datatables.js在asp.net mvc5中的使用

实体层Area.csusing System; using System.Collections.Generic; using System.Linq; using System.Web;namespace MvcDemo.Models { public class Area { public int Id { get; set; } public s

极客神殿 1623

【SpringBoot 4.x 第2节】夯爆了,学习 Spring Boot 4.x 前,需要具备哪些 Java 基础?

🏆 本文收录于 《滚雪球学 Spring Boot 4.x》 专栏。 本专栏面向 有一点 Java 基础,但没有系统学过 Spring Boot 的读者,采用“滚雪球式学习法”:先跑通、再理解、再重构、再上线,最终带你从第一个 Hello API 一路完成一个可部署、可监控、可扩展的后端项目。

**My Coding Family** 4570

DataTable.js源代码分析(一)

1.DataTable.js DataTable.js是DT主文件。在这个文件里会通过require引用同目录下ext\js\core\api中的js文件。以下划线开头的函数方法基本上 都是全局变量,这些方法都在api和core两个文件夹中。 /*! * @summary DataTables * @description Paginate, search and sort HTML ...

极客神殿 1570

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

C# WinForm 基于DirectShow.dll编写的程序,可边预览边保存视频,音频和图片

基于微软的DirectShow.dll的二次开发1.自动识别连接的摄像头跟麦克风且可以对其进行选择(默认选中第一个)2.可录制wmv和avi两种格式的视频并且都带有音频,avi可以录制的分辨率和帧数进行选择,wmv默认进行了淸晰度优化如不喜欢可去除代码中有相关提示3.可在预览点开之后进行拍照,也可边录制视频边拍照4.添加了视频和音频的压缩功能(酌情使用)这次二次开发发现C#对DirectShow的相关信息太少,这次做完也不敢藏私共享出来,还望大家指正

DataTable源代码分析(开篇)

D

月球人的专栏 2263

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

DataTable 基础操作一 往DataTable中添加数据

DataTable dt=new DataTable(); //新建一个DataTable的实例dt DataRow dr; //声明一个DataRow实例dr dt.Columns.Add(new DataColumn("编号",typeof(Int32))); //说明DataTable表里的包含哪些字段 dt.Columns.Add(new DataColumn("用户名",typeof(s

Nightmare的专栏 3084

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

DataTable基础(一)

   最近公司闲着无聊在网上就查了一些关于DATABLE的使用方法,在这与朋友们分享一下,希望对大家能有所帮助,相信你们DATATABLE的时候都是先绑定数据库然后再操作DATATABLE的吧。但是如果我想要改变某一行的数据怎么办呢,我想做项目的人都会碰到这类的问题,现在在这可以告诉大家一个方法,不过在这之前我们先来了解一下DATATABLE的一些基本的东西。在DataTable定义完全后就相当于定义了表的行和列,就可以通过将DataRow对象添加表的数据行,与DataRow相似DataColumn就可以添

yinjianjing的专栏 869

使用反射机制用一个类实例的值为DataTable添加一行

  这里的类实例拥有的字段类型和数量大于等于DataTable中的列,类实例的字段对应DataTable中的一列,类实例还可以有自定义的字段,不包含在DataTable列中:源代码如下: /// /// 为DATATABLE增加一行数据/// 编辑的实体类/// 要编辑的DataTable/// 添加失败返回-1,否则返回添加后的总行数/// public stat

A1027的专栏 2028

datatable 遍历

DataTable的实例化以及添加列: DataTable dt = new DataTable();  //先建一个DATATABLE dt.Columns.Add("ID"); // 给这个table加列 dt.Columns.Add("Name"); DataRow dr = dt.NewRow(); //声明行 object[] objs = { 1, "Name" }; //赋值 dr.ItemArray = objs; dt.Rows.Add(dr); /

爱飞的蒲公英 5637

将两个DataTable合并——DataTable.Merge 方法

privatestaticvoidDemonstrateMergeTable(){DataTabletable1=newDataTable("Items");//AddcolumnsDataColumnidColumn=newDataColumn("id",typeof(System.Int32));DataColumnitemColumn=newDataColumn("item",typeof(System.Int32));table1.Columns.Add(idColumn)

书中自有妍如玉的博客 4536

C# DataTable 去重

C# DataTable 的一些用法 去重 DataTable datatable = new DataTable(); datatable.DefaultView.ToTable(true); 未完,查看如些页面 https://www.cnblogs.com/Fooo/p/6666825.html?utm_source=itdadao&utm_medium=referral

u012577058的博客 6072

WebService返回DataTable

webservice返回datatable时报序列化错误 以下三种方案的实质应该都是序列化的,有一位大神说过“跨进程的不序列化应该去面壁!”O(∩_∩)O哈哈哈~ 解决方案一:返回dataset WebService中的方法代码如下:       [WebMethod]     public DataSet GetDataSet()     {         DataTable

程序亦人生 4335

将两个DataTable合并成一个DataTable

//1.两个结构一样的DT合并DataTable DataTable1 = new DataTable();DataTable DataTable2 = new DataTable();DataTable newDataTable = DataTable1.Clone(); object[] obj = new object[newDataTable.Columns.Count];for (int...

weixin_33965305的博客 4041

Angularjs 与 dataTable 的结合(一)

1. Angularjs 与 dataTable的结合 html 部分 Document Add Data This table uses columns defined in controller 2. angularjs部分 angul

李登辉的博客 1万+

h:dataTable t:dataTable 以及对 t:dataTable 功能修改

适用于对jsf有基本了解的朋友:关于dataTable介绍一下jsf的dataTable1      标准的h:dataTable                        效果如下,其中FX代表firstname,LX代表lastNamefirstName  lastNameF1               L1F2        

我的砖栏我的砖 4437

如何将xml解析成datatable

/// /// 解析XML成DATATABLE /// /// xml格式文本 private DataTable parseXML2DataTable(string strXMl) { XmlDocument dom = new XmlDocument(); //加

LOVE_MOLY的博客 805
上一篇: DataTable源代码分析(开篇)
月球人
博客等级 码龄15年 6粉丝 40原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值