Asp中一些FSO方面的函数

ESP32S3 TLS 握手WIFI可用但是在蜂窝热点下卡死:排查方法与根因 设备卡在等。 阅读详情
Asp中一些FSO方面的函数


''取文件大小
Function GetFileSize(FileName)
''//功能:取文件大小
''//形参:文件名
''//返回值:成功为文件大小,失败为-1
''//
Dim f
If ReportFileStatus(FileName) = 1 Then
Set f = fso.Getfile(FileName)
GetFileSize = f.Size
Else
GetFileSize = -1
End if
End Function

''文件删除
Function deleteAFile(filespec)
''//功能:文件删除
''//形参:文件名
''//返回值:成功为1,失败为-1
''//
If ReportFileStatus(filespec) = 1 Then
fso.deleteFile(filespec)
deleteAFile = 1
Else
deleteAFile = -1
End if
End Function

''显示文件列表
Function ShowFileList(folderspec)
''//功能:目录存在时显示此目录下的所有文件
''//形参:目录名
''//返回值:成功为文件列表,失败为-1
''//
Dim f, f1, fc, s
If ReportFolderStatus(folderspec) = 1 Then
Set f = fso.GetFolder(folderspec)
Set fc = f.Files
For Each f1 in fc
s = s & f1.name
s = s & "|"
Next
ShowFileList = s
Else
ShowFileList = -1
End if
End Function

''!!!
''文件复制
Function CopyAFile(SourceFile,DestinationFile)
''//功能:源文件存在时,才能对文件进行复制,目的文件无影响
''//形参:源文件,目的文件
''//返回值:成功为1,失败为-1
''//
Dim MyFile
If ReportFileStatus(SourceFile) = 1 Then
Set MyFile = fso.GetFile(SourceFile)
MyFile.Copy (DestinationFile)
CopyAFile = 1
Else
CopyAFile = -1
End if
End Function

''文件移动
''Response.Write MoveAFile("f:/123/4561.exe","f:/123/4562.txt")
Function MoveAFile(SourceFile,DestinationFile)
''//功能:源文件存在时目的文件不存在时才能对文件进行移动
''//形参:源文件,目的文件
''//返回值:成功为1,失败为-1
''//
If ReportFileStatus(SourceFile)=1 And ReportFileStatus(DestinationFileORPath) =

-1 Then
fso.MoveFile SourceFile,DestinationFileORPath
MoveAFile = 1
Else
MoveAFile = -1
End if
End Function

''文件是否存在?
''Response.Write ReportFileStatus("G:/soft/delphi/my_pro/代码库.exe")
Function ReportFileStatus(FileName)
''//功能:判断文件是否存在
''//形参:文件名
''//返回值:成功为1,失败为-1
''//
Dim msg
msg = -1
If (fso.FileExists(FileName)) Then
msg = 1
Else
msg = -1
End If
ReportFileStatus = msg
End Function


''文件创建日期
''Response.Write ShowDatecreated("G:/soft/delphi/my_pro/代码库.exe")
''Response.Write ShowDatecreated("G:/soft/delphi/my_pro/复件 代码库.exe")
Function ShowDatecreated(filespec)
''//功能:文件创建日期
''//形参:文件名
''//返回值:成功:文件创建日期,失败:-1
''//
Dim f
If ReportFileStatus(filespec) = 1 Then
Set f = fso.GetFile(filespec)
ShowDatecreated = f.Datecreated
Else
ShowDatecreated = -1
End if
End Function

''文件属性
''Response.Write GetAttributes("G:/soft/delphi/my_pro/复件 代码库.exe")
Function GetAttributes(FileName)
''//功能:显示文件属性
''//形参:文件名
''//返回值:成功:文件属性,失败:-1
''//
Dim f,Str
If ReportFileStatus(FileName) = 1 Then
Set f = fso.GetFile(FileName)
select Case f.attributes
Case 0 Str="普通文件。没有设置任何属性。 "
Case 1 Str="只读文件。可读写。 "
Case 2 Str="隐藏文件。可读写。 "
Case 4 Str="系统文件。可读写。 "
Case 16 Str="文件夹或目录。只读。 "
Case 32 Str="上次备份后已更改的文件。可读写。 "
Case 1024 Str="链接或快捷方式。只读。 "
Case 2048 Str=" 压缩文件。只读。"
End select
GetAttributes = Str
Else
GetAttributes = -1
End if
End Function

''最后一次访问/最后一次修改时间
''Response.Write ShowFileAccessInfo("G:/soft/delphi/my_pro/复件 代码库.exe")
Function ShowFileAccessInfo(FileName,InfoType)
''//功能:显示文件创建时信息
''//形参:文件名,信息类别
''// 1 -----创建时间
''// 2 -----上次访问时间
''// 3 -----上次修改时间
''// 4 -----文件路径
''// 5 -----文件名称
''// 6 -----文件类型
''// 7 -----文件大小
''// 8 -----父目录
''// 9 -----根目录
''//返回值:成功为文件创建时信息,失败:-1
''//
Dim f, s
If ReportFileStatus(FileName) = 1 then
Set f = fso.GetFile(FileName)
select Case InfoType
Case 1 s = f.Datecreated ''// 1 -----

创建时间
Case 2 s = f.DateLastAccessed ''// 2 -----上次访问

时间
Case 3 s = f.DateLastModified ''// 3 -----上次修改

时间
Case 4 s = f.Path ''// 4

-----文件路径
Case 5 s = f.Name ''// 5

-----文件名称
Case 6 s = f.Type ''// 6

-----文件类型
Case 7 s = f.Size ''// 7

-----文件大小
Case 8 s = f.ParentFolder ''// 8 -----

父目录
Case 9 s = f.RootFolder ''// 8 -----

根目录
End select
ShowFileAccessInfo = s
ELse
ShowFileAccessInfo = -1
End if
End Function

''写文本文件
Function WriteTxtFile(FileName,TextStr,WriteORAppendType)
Const ForReading = 1, ForWriting = 2 , ForAppending = 8
Dim f, m
select Case WriteORAppendType
Case 1: ''文件进行写操作
Set f = fso.OpenTextFile(FileName, ForWriting, True)
f.Write TextStr
f.Close
If ReportFileStatus(FileName) = 1 then
WriteTxtFile = 1
Else
WriteTxtFile = -1
End if
Case 2: ''文件末尾进行写操作
If ReportFileStatus(FileName) = 1 then
Set f = fso.OpenTextFile(FileName, ForAppending)
f.Write TextStr
f.Close
WriteTxtFile = 1
Else
WriteTxtFile = -1
End if
End select
End Function

''读文本文件
Function ReadTxtFile(FileName)
Const ForReading = 1, ForWriting = 2
Dim f, m
If ReportFileStatus(FileName) = 1 then
Set f = fso.OpenTextFile(FileName, ForReading)
m = f.ReadLine
''m = f.ReadAll
''f.SkipLine
ReadTxtFile = m
f.Close
Else
ReadTxtFile = -1
End if
End Function

''建立文本文件



''//==================================目录操作==================================

''取目录大小
Function GetFolderSize(FolderName)
''//功能:取目录大小
''//形参:目录名
''//返回值:成功为目录大小,失败为-1
''//
Dim f
If ReportFolderStatus(FolderName) = 1 Then
Set f = fso.GetFolder(FolderName)
GetFolderSize = f.Size
Else
GetFolderSize = -1
End if
End Function

''创建的文件夹
Function createFolderDemo(FolderName)
''//功能:创建的文件夹
''//形参:目录名
''//返回值:成功为1,失败为-1
''//
Dim f
If ReportFolderStatus(Folderspec) = 1 Then
createFolderDemo = -1
Else
Set f = fso.createFolder(FolderName)
createFolderDemo = 1
End if
End Function


''!!!
''目录删除
Function deleteAFolder(Folderspec)
''//功能:目录删除
''//形参:目录名
''//返回值:成功为1,失败为-1
''//
Response.write Folderspec
If ReportFolderStatus(Folderspec) = 1 Then
fso.deleteFolder (Folderspec)
deleteAFolder = 1
Else
deleteAFolder = -1
End if
End Function

''显示目录列表
Function ShowFolderList(folderspec)
''//功能:目录存在时显示此目录下的所有子目录
''//形参:目录名
''//返回值:成功为子目录列表,失败为-1
''//
Dim f, f1, fc, s
If ReportFolderStatus(folderspec) = 1 Then
Set f = fso.GetFolder(folderspec)
Set fc = f.SubFolders
For Each f1 in fc
s = s & f1.name
s = s & "|"
Next
ShowFolderList = s
Else
ShowFolderList = -1
End if
End Function

''!!!!
''目录复制
Function CopyAFolder(SourceFolder,DestinationFolder)
''//功能:源目录存在时,才能对目录进行复制,目的目录无影响
''//形参:源目录,目的目录
''//返回值:成功为1,失败为-1
''//
''Dim MyFolder
''If ReportFolderStatus(SourceFolder) = 1 and ReportFolderStatus

(DestinationFolder) = -1 Then
''Set MyFolder = fso.GetFolder(SourceFolder)
fso.CopyFolder SourceFolder,DestinationFolder
CopyAFolder = 1
''Else
CopyAFolder = -1
''End if
End Function


''目录进行移动
Function MoveAFolder(SourcePath,DestinationPath)
''//功能:源目录存在时目的目录不存在时才能对目录进行移动
''//形参:源目录,目的目录
''//返回值:成功为1,失败为-1
''//
If ReportFolderStatus(SourcePath)=1 And ReportFolderStatus(DestinationPath)=0

Then
fso.MoveFolder SourcePath, DestinationPath
MoveAFolder = 1
Else
MoveAFolder = -1
End if
End Function

''判断目录是否存在
''Response.Write ReportFolderStatus("G:/soft/delphi/my_pro/")
Function ReportFolderStatus(fldr)
''//功能:判断目录是否存在
''//形参:目录
''//返回值:成功为1,失败为-1
''//
Dim msg
msg = -1
If (fso.FolderExists(fldr)) Then
msg = 1
Else
msg = -1
End If
ReportFolderStatus = msg
End Function

''目录创建时信息
Function ShowFolderAccessInfo(FolderName,InfoType)
''//功能:显示目录创建时信息
''//形参:目录名,信息类别
''// 1 -----创建时间
''// 2 -----上次访问时间
''// 3 -----上次修改时间
''// 4 -----目录路径
''// 5 -----目录名称
''// 6 -----目录类型
''// 7 -----目录大小
''// 8 -----父目录
''// 9 -----根目录
''//返回值:成功为目录创建时信息,失败:-1
''//
Dim f, s
If ReportFolderStatus(FolderName) = 1 then
Set f = fso.GetFolder(FolderName)
select Case InfoType
Case 1 s = f.Datecreated ''// 1 -----

创建时间
Case 2 s = f.DateLastAccessed ''// 2 -----上次访问

时间
Case 3 s = f.DateLastModified ''// 3 -----上次修改

时间
Case 4 s = f.Path ''// 4

-----文件路径
Case 5 s = f.Name ''// 5

-----文件名称
Case 6 s = f.Type ''// 6

-----文件类型
Case 7 s = f.Size ''// 7

-----文件大小
Case 8 s = f.ParentFolder ''// 8 -----

父目录
Case 9 s = f.RootFolder ''// 9 -----

根目录
End select
ShowFolderAccessInfo = s
ELse
ShowFolderAccessInfo = -1
End if
End Function

Function DisplayLevelDepth(pathspec)
Dim f, n ,Path
Set f = fso.GetFolder(pathspec)
If f.IsRootFolder Then
DisplayLevelDepth ="指定的文件夹是根文件夹。"&RootFolder
Else
Do Until f.IsRootFolder
Path = Path & f.Name &"<br>"
Set f = f.ParentFolder
n = n + 1
Loop
DisplayLevelDepth ="指定的文件夹是嵌套级为 " & n & " 的文件夹。<br>"&

Path
End If
End Function

''//==================================磁盘操作==================================
''驱动器是否存在?
''Response.Write ReportDriveStatus("C:/")
Function ReportDriveStatus(drv)
''//功能:判断磁盘是否存在
''//形参:磁盘
''//返回值:成功为1,失败为-1
''//
Dim msg
msg = -1
If fso.DriveExists(drv) Then
msg = 1
Else
msg = -1
End If
ReportDriveStatus = msg
End Function

''--------可用的返回类型包括 FAT、NTFS 和 CDFS。
''Response.Write ShowFileSystemType("C:/")
Function ShowFileSystemType(drvspec)
''//功能:磁盘类型
''//形参:磁盘名
''//返回值:成功为类型:FAT、NTFS 和 CDFS,失败:-1
''//
Dim d
If ReportDriveStatus(drvspec) = 1 Then
Set d = fso. GetDrive(drvspec)
ShowFileSystemType = d.FileSystem
ELse
ShowFileSystemType = -1
End if
End Function
End Class


%>

极智AI | 谈谈为什么卷积加速更喜欢 NHWC Layout 本文主要讨论一下为什么卷积加速更加喜欢 NHWC 的数据排布。 阅读详情

相关推荐

OGG工具实现MySQL同步到Oracle数据库

OGG工具实现MySQL同步数据到Oracle

Mrzhou的博客 1682

ASP文件操作(FSO)详解

实例一:写入文件 语法 object.CreateTextFile([要建立的文件],[如存在,是否替代]) <% Set fs =Server.CreateObject("Scripting.FileSystemObject") Set a = fs.CreateTextFile(server.MapPath("ss.txt"), True) ’a = fs.Creat...

资料汇总整理-仅供个人学习使用 2415

JavaScript 书签脚本实战:腾讯/优酷/爱奇艺等5大视频站m3u8链接一键提取

本文详细介绍了如何使用JavaScript书签脚本一键提取腾讯视频、优酷、爱奇艺等五大视频平台的m3u8流媒体链接。通过分析播放器内部对象结构,开发者可以高效获取视频源文件,避免录屏画质损失。文章包含各平台适配方案、实战增强功能开发及企业级解决方案设计,帮助用户快速掌握这一实用技术。

weixin_27945229的博客 600

用FSO删除文件夹

删除文件夹dim fso=server.createobject("script.fileSystemObject")if fso.folderexists(Server.MapPath(filename))  then    fso.deleteFolder(Server.MapPath(filename))end if 删除文件if fso.FileExists(Server.MapPath(

Adot84的专栏 1990

2019年7月28日解决战网BLZBNTBNA00000005BLZBNTBNA00000006BLZBNTBTS0000005DBLZBNTBTS0000004A 007D0 008A4 00840

Blizzard—Battle.net—2019年7月28解决战网BLZBNTBNA00000005BLZBNTBNA00000006BLZBNTBTS0000005DBLZBNTBTS0000004A 007D0 008A4 008402019年7月28日再次更新写在前面■■■ 排查网路问题 ■■■■■■ 排查电脑自身问题 ■■■■尝试重置internet设置■网络的设置和防火墙规则■如果还是不...

MCGC高质人类协作会-MCG贴吧 3万+

QT快速配置MSVC2017编译环境(3分钟极简指南)

本文提供了一份3分钟极简指南,帮助开发者快速配置QT的MSVC2017编译环境。通过断网安装、精准勾选组件和配置QT Creator编译器路径等步骤,大幅提升QT开发效率。MSVC2017作为Windows平台高性能C++编译器,特别适合处理大型QT项目,编译速度优势明显。

weixin_30399821的博客 503

[asp编程]深入理解ASP中FSO的神奇功能(2)

在OpentextFile的命令参数中定义了TRUE,这就告诉了系统,如果文件不存在,就创建它。如果文件不存在,并且没有定义TRUE参数,就会出错。        现在转到目录c: emp,打开test.txt,你可以看到如下的信息:      Users name   Users home page   Users email        当然,这些单词可以被输入在表单中的任何内容所替换

801

Agentic AI上下文工程架构终极指南:全面解决智能体理解问题

在开始架构设计前,我们需要先明确两个核心概念——Agentic AI和上下文工程。Agentic AI(智能体AI)是具备自主目标、环境交互、任务分解能力的AI系统。自主性:不需要人类逐步指令,能自己规划任务(比如“帮我订机票”→自动分解为“查航班→选座位→填信息→支付”);动态性:能根据环境变化调整行为(比如订机票时发现航班延误,自动改签到下一班);连续性:能记住历史交互(比如“上次你说喜欢靠窗位,这次帮你预留了”)。

AI开发架构师 1116

FSO总结

目 录1----10   -----------------------------------------------------ASP中FSO的神奇功能11---    ----------------------------------------------------FSO+递归生成文件列表(xml) ASP中FSO的神奇功能原文出处:http://www.15seconds.com/I

田林的博客 1282

Xilinx System Generator多速率系统(Multi-Rate Systems)的使用

在本实验练习中,您将学习在System Generator中如何使用多个时钟域有效地实现具有多个数据速率的设计。

白码王子小张的博客 1092

西门子博图指令(定时器操作三)

西门子博图定时器中复位定时器功能指令介绍

yue008的博客 8871

ASP中常用的22个FSO文件操作函数

ASP中常用的22个FSO文件操作函数 2009年07月29日   ASP中FSO组件的功能很强大,如果没有FSO很难想象ASP会变成什么样。对于学习asp编程的朋友一定会接触到FSO相关的操作,如备份数据库,读取文件,生成静态页面等等。本文就列举了ASP中常用的22个FSO文件操作函数,相信能为您带来方便 !   [b]1.[/b][b]文件操作,取文件大小[/b]   Fu...

tcf171jl 256

SAP Clean Core 对传统 ABAP 开发人员来说意味着什么:机遇和挑战

SAP Clean Core是一种战略方法,旨在优化和现代化 SAP S/4HANA 系统,通过尽量减少定制,确保核心系统的稳定性、高效性和对云环境的兼容性。Clean Core 作为一种设计思路,致力于让 ERP 系统的核心功能保持简洁、规范,避免不必要的复杂化,最终维持一个标准化的核心,使系统更容易升级、性能更优越,同时支持快速的创新能力。

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 609

ASP FSO文件处理函数大全

代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><% '建立文件夹函数 Function CreateFolder(strFolder)'参数为相对路径 '首选判断要建立的文件夹是否已经存在 Dim strTestFol

何足道也 1470

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

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

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

ASP中FSO相关的一些函数

&lt;%'//============文件操作============== '取文件大小 Function GetFileSize(FileName) '//功能:取文件大小 '//形参:文件名 '//返回值:成功为文件大小,失败为-1 '// Dim f If ReportFileStatus(FileName) = 1 Then Set f = fso.Getfile(FileName) G...

菜刀舞的快一点,武林高手也是难以近身的。 126

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

FSO读取文本文件 ASP函数

'[读取文本文件] '函数名:ReadTextFile '作 用:读取文本文件 '参 数:Fname ---- 文本文件名称(包括路径) '返回值:返回读取的文本内容 '************************************************** Public Function ReadTex...

185

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

java fso_FSO一些代码

FSO一些代码更新时间:2006年08月26日 00:00:00 作者:使用FSO修改文件特定内容的函数functionFSOchange(filename,Target,String)DimobjFSO,objCountFile,FiletempDataSetobjFSO=Server.CreateObject("Scripting.FileSystemObject")Setob...

weixin_35128544的博客 172

QTP_ASP FSO文件处理函数大全

代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--&gt;&lt;% '建立文件夹函数 Function CreateFolder(strFolder)'参数为相对路径     '首选判断要建立的文件夹是否已经存在     Dim strTestFo...

星火baba 823

ASP中最常用的22个FSO文件操作函数12-22

12.FSO返回文件夹目录空间大小Function GetFolderSize(FolderName)   ’//功能:取目录大小   ’//形参:目录名   ’//返回值:成功为目录大小,失败为-1   ’//   Dim f   If ReportFolderStatus(FolderName) = 1 Then   Set f = fso.GetFolder(FolderName)  

从现在go,一切都不迟 971
上一篇: asp用存储过程实现快速分页
下一篇: 一些不长见的ASP调用存储过程的技巧
webdevelop
博客等级 码龄24年 2粉丝 8原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值