DNS 101

魔百盒CM101h刷完当贝桌面后,这6个隐藏功能设置让你的电视盒子更好用 本文详细介绍了中国移动魔百盒CM101h刷入当贝桌面后的6个高阶玩法,包括开机自启动、应用隐藏、儿童锁、HDMI自动切换、DNS优化和存储空间清理。这些技巧能显著提升电视盒子的使用体验,特别适合追求个性化和高效操作的用户。 阅读详情

As stated earlier, DNS is a distributed data base. When you pay a fee to register a domain one of the questions you answer deals with your Name Servers. You have to list two and they have to be registered in the DNS system.

The domain name system database has three levels. The first group of servers we call "root" servers. The second we call Top Level Domains or (TLDs). When your resolver needs to find the address for a web site, it makes a query.

Let's say you want to find Google.com. Your resolver asks the Root servers to identify Google.com's IP. The Root server replies, I don't know but I do now where you can find the answer. Start with the TLD servers for COM.

So, Root sends your query to a COM server. It says, OK. I don't have that information but I know a Name Server that does. It has an address of64.233.167.99 and the name ns1.google.com. So, go to that address and it will tell you the web site address of google.com

Your resolver takes the information from ns1.google.com and returns with an IP address. If Google's name server gave your resolver the correct name, you'll get a web page.

The path traveled looks like Figure 1.



Figure 1 - From Root to your Domain. (这个图解释了域名是如何被解析的:root-->一级域名服务器-->域名对应的name server)

In the upper left of Figure 1, we have depicted a set of servers with the annotation of Root. In the jargon of DNS, these servers represent the beginning of the DNS path. You will see them represented by a period or dot ("."). In your configuration files, your IP address to name mapping will end with a period. When we look at some of those files in a few minutes this will become clearer.

The Root servers are the top of the distributed DNS database. They have information about the Top Level Domains(TLDs). TLDs include com, net, org, mil, gov, edu, etc. When you contract to use a domain name, you chose which TLD you want. In my case, I have a domain in the org name space called centralsoft.org.

(com, net, org, ... 这些都是一级域名;google, baidu, ... 这些是二级域名;以此类推)

When I registered my name servers, I gave the name of server1.centralsoft.org and ns0.centralsoft.org to my registration agent. In the TLD servers for org, you will find my name servers. The org servers know where you should find information on centralsoft.

When I registered, I told the agent that I would take responsibility for maintaining a database of IP addresses and friendly names and map them to one another. So, we made an agreement and the Domain Name System said, "OK, now you have authority for the data on centralsoft.org. When someone wants to find the services you offer on the Internet, we will point them to you."

So, now I have to run an application which can answer your queries and say, "sure if you want to see my web page or send mail to one of my users, you can find them here. If you ask me for a name, I'll give you an IP address because I know you have this protocol which uses TCP/IP and I realize you need the address, even when you specify a name".

(域名服务器的作用就是:查到用户想访问的域名的IP地址)

That's where BIND comes into play. The people who maintain the BIND code make sure it meets the specifications of the Internet Engineering Task Force and will run on your server. All you have to do is learn how it does what it does.

Named lives on a domain name server and answers queries from resolvers. The application reads its data from a configuration file called named.conf. named.conf gets its information from something we call zone files. Several zone files exist, but one zone file in particular keeps a database of records that supply named with most of its answers.

In Figure 2, named had received a query. It looks to its configuration file named.conf, which looks to the primary zone file and hands off the information requested to the resolver from the outside.



Figure 2 - Answering a query

Some people refer to configuration files as rule files. BIND's configuration files seem like rule files to me. The rules of Domain Name Services require tight compliance. Making and resolving queries follow strict protocols on the Internet as does the interprocess communication within BIND.

Let's refer to Figure 2 again and look at the process. You should have BIND installed and running on your server. If not, we will address installation and configuration in one of the next sections.

The named process listens on port 53 of a Linux system. When it receives a query for an address, it looks to the first configuration file about which it knows: named.conf.



Figure 3 - named.conf (是bind的配置文件,里面含有域名的zone文件)

The following table depicts a simple named.conf file. If you have seen a file like this and didn't understand it, then let's break it down into its components. Once we do that, we can take the mystery out of it.

options {
pid-file "/var/run/bind/run/named.pid";
directory "/etc/bind";(指定zone文件的位置)
// query-source address * port 53; };

//
// a master nameserver config
//
zone "." {
type hint;
file "db.root";
};

zone "0.0.127.in-addr.arpa" {
type master;
file "db.local";
};

zone "158.253.70.in-addr.arpa" {
type master;
file "pri.158.253.70.in-addr.arpa";
};

zone "centralsoft.org" {
type master;
file "pri.centralsoft.org";
};

This file refers to the four other configuration files. The third line down lists the directory containing them all, /etc/bind where they exist.

The options statement defines the default directory for named and the location of the process ID (pid) file. named.pid represents the daemon itself. If you followed any of the Perfect Setup Tutorials, we put it in a chrooted environment.

The zone statement identifies the location of the hints, localhost, zone and reverse zone files.

  • Hints file(root name server的位置:1. 一级NS的地址;2. 权威NS的地址)
    This file contains the names and addresses of the root servers on the Internet. These know where the authoritative servers for your domain exist - the first one being the Top Level Domain (com, net, org, etc.) and next being the authoritative server for your domain. 

  • Local host file (本地NS)
    Name servers are the masters of their own loopback domain (127.0.0.1). The point of creating local zone files for each aspect of your of localhost is to reduce traffic and allow the same software to work on your system as it does on the network. 

  • Zone file (zone文件,一个域名对应一个zone文件)
    This file, also called the domain database, defines most of the information needed to resolve queries about the domain you administer. It maps names to IP addresses and provides information about the services offered by your Internet computer including your web and ftp server, email, telnet, name servers, etc. 

    The zone file uses several record types including the SOA or start of authority; NS or name server; A or host name to address map; PTR or pointer which maps addresses to names; MX or mail exchanger which identifies the mail servers in the domain; and CNAME or canonical name which defines an alias for a host name.

    Don't try to memorize or understand what these record types mean at this point. Just realize that they exist and you will have ample opportunity to use them.


  • Reverse zone file (反向域名zone文件,域名反向解析)
    Another way to talk about zone files is to define them something that links all the IP addresses in your domain to their corresponding server. The reverse zone file maps IP addresses to host files. It's a mirror image of the database file above. You can recognize a reverse zone file because it has the extension of in-addr.arpa.




Figure 4 - Zone files


@ IN SOA server1.centralsoft.org. root.localhost. (
2006012103; serial
28800; refresh, seconds
7200; retry, seconds
604800; expire, seconds
86400 ); minimum, seconds

;
NS server1.centralsoft.org.;(主域名服务器)
NS ns0.centralsoft.org. ;(备用域名服务器)

;
MX 10 server1.centralsoft.org.;

;
;(以下是A记录,用于查询域名对应的IP地址)
centralsoft.org. A 70.253.158.42
www A 70.253.158.42
server1 A 70.253.158.42(主域名服务器地址)
ns0 A 70.253.158.45(备用域名服务器地址)

SOA refers to "Start of Authority" (起始授权机构). When you look at Figure 1, remember that DNS distributes its database. By the time you enter the picture, the system has handed off authority for part of the entire database to you. So, your zone file has to indicate where your authority starts. Your authority starts in your zone file. Your Top Level Domain servers are waiting for you to do your part of the job.

(一级域名服务器把解析请求发到这儿,需要进一步做解析)

The data field of the SOA record contains several components or fields. You need to provide data or answers in the record which will allow another server on the Internet to satisfy its query. Think of the data field as a computer RECORD which has several fields. They include:

  • Name

    The root name of the zone. The "@" sign is a shorthand reference to the current origin (zone) in the /etc/named.conf file for that particular database file. The host name of the master server for this zone is server1.centralsoft.org. Don't worry if this jargon doesn't make sense. If just means that back in the named.conf configuration file an entry points to this file and this file points back to the entry in the configuration file.

  • Class

    A number of different DNS classes exist. For our purposes we will use the IN or Internet class used when defining IP address mapping information for BIND. The other classes exist for non Internet protocols and functions.

  • Type

    The type of DNS resource record. In the example, this is an SOA resource record.

  • Name-server

    Fully qualified name of your primary name server. Must be followed by a period.

  • Email-address

    This is the email address of the person responsible for the domain. Notice that instead of an @ sign, the address uses a period and is followed by a period. In this case, the email address is the root user or root.loalhost. In other applications the email address would be root@localhost.

  • Serial-no (更新了以后,备用slave域名服务器也会更新zone文件配置)

    A serial number for the current configuration is usually in a date format YYYYMMDD with an incremented double digit number tagged to the end. This allows you to do multiple edits each day with a serial number that both increments and reflects the date on which the change was made. It's a numeric value that the slave server can use to check whether the zone file has been updated. The slave periodically checks the serial number to see if it has changed. If it has, the slave will perform a zone transfer. 2006012103 is the serial number in the zone file above.

  • Refresh

    This field tells a slave DNS server how often it should check the master. This field represents a length in seconds. Every refresh cycle, the slave server checks to see whether it needs to perform a zone transfer. In this file we use 28800 as the value.

  • Retry

    This field tells the slave how often it should try to connect to the master in the event of a connection failure. The interval in our example is 7200.

  • Expiry

    Total amount of time a slave should retry to contact the master before expiring the data it contains. Future references will be directed towards the root servers. This is the expiration time, the length of time that the slave server should continue to respond to queries even if it cannot update the zone file. An expiration period exists under the theory that out of date data is worse than no data at all. In our example we use 604800.

  • Minimum-TTL
This is the default time to live (TTL) for this domain in seconds. Times will occur when remote clients will make queries for sub-domains that don't exist in your records. If so configured, your DNS server will respond with a no domain or NXDOMAIN response that the client's remote server caches. The TTL value defines the caching duration your DNS response. The value is included in your server's response. Any resource record that does not have a specified TTL uses this default. Because 86400 seconds is one day, the querying cache's record should die in one day.


最后,dig是一个很好的工具,

$dig www.baidu.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-16.P1.el5 <<>> www.baidu.com
;; global options:  printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19051
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 1

;; QUESTION SECTION:(请求)
;www.baidu.com.                 IN      A

;; ANSWER SECTION:(回答)
www.baidu.com.          99      IN      CNAME   www.a.shifen.com. (CNAME也就是化名,重新请求解析www.a.shifen.com)
www.a.shifen.com.       458     IN      A       119.75.217.56 (A记录,域名对应的IP地址)
www.a.shifen.com.       458     IN      A       119.75.218.45 (A记录,域名对应的IP地址)

;; AUTHORITY SECTION:(权威服务器域名)
a.shifen.com.           5927    IN      NS      ns4.a.shifen.com.
a.shifen.com.           5927    IN      NS      ns5.a.shifen.com.
a.shifen.com.           5927    IN      NS      ns6.a.shifen.com.
a.shifen.com.           5927    IN      NS      ns2.a.shifen.com.

;; ADDITIONAL SECTION:
ns6.a.shifen.com.       76      IN      A       220.181.4.178 (A记录,权威域名服务器IP地址)

;; Query time: 79 msec
;; SERVER: 222.73.13.68#53(222.73.13.68)
;; WHEN: Tue Nov  8 15:58:23 2011
;; MSG SIZE  rcvd: 178


Linkerd 101:如何使用Linkerd监控外部DNS请求 摘要:本文介绍了如何在Kubernetes环境中使用Linkerd服务网格监控外部DNS请求。通过创建ExternalName服务和ServiceProfile配置,可以跟踪外部请求的指标数据。文章详细说明了配置步骤和验证方法,并指出当前版本Linkerd对外部服务路由指标支持尚不完善,建议结合其他监控工具使用。随着服务网格技术发展,Linkerd有望在未来版本中完善这一功能,实现更全面的微服务通信监控。 阅读详情

相关推荐

华为IAD101S/101H/102H/104H配置与MGCP注册、PSTN切换

在NGN综合接入场景中,语音网关承担模拟电话与IP语音网之间的媒体转换和信令交互。其核心原理是通过IP层可达、MGCP/SIP信令注册、业务层拨测三层协同,把POTS语音流封装为IP包,并由SoftX3000等软交换控制。技术价值在于降低传统PSTN接入改造成本,实现VoIP与PSTN逃生、一机双号及远程运维。典型应用覆盖企业分支、机房综合接入和无人值守点位语音上收。华为IAD101S/101H/102H/104H正是此类媒体接入网关,配置时需通过Telnet进入命令行,完成静态/DHCP/PPPoE地址、

weixin_29252171的博客 223

Internet101- 2 - IP Address & DNS (IP地址 & DNS)

内容来源:KhanAcademy-Internet101- IP Address and DNS (原视频和字幕、评论为英文,下面中文内容为个人理解后,查阅网络资料所作翻译,仅供参考;部分中文定义源自百度百科) 1. 相关名词   ISP - Internet Service Provider 互联网服务提供商   当你用笔记本或者手机连上WiFi,WiFi会连接到ISP...

weixin_30448685的博客 283

GD32模拟IIC读写DVC1124

GD32模拟IIC读写集澈AFE芯片DVC1124

ponyma_的博客 1227

域服务器的dns:::1_网络101:什么是DNS查询?

域服务器的dns:::1DNS is a topic which is often considered difficult to understand, but the basic thesis of it is actually not hard to grasp if explained correctly — which is the very aim of this article. T...

weixin_26753891的博客 540

TI DSP的 FFT与IFFT库函数的使用测试

/** * Copyright (C) 2013 Guangzhou Tronlong Electronic Technology Co., Ltd. - www.tronlong.com * * @file dsplib_fft.c * * @brief Example application main file. * This application will run FFT performance test. * * @author Tronlong <support@tron.

ToneChip的专栏,一个传统的嵌入式码农,裸机编程 2678

即插即用!5分钟为你的SNN模型添加频谱注意力(DCT-SA模块实战)

本文介绍了如何为脉冲神经网络(SNN)快速集成即插即用的DCT-SA频谱注意力模块。该模块利用离散余弦变换(DCT)在频率域自适应加权特征,能有效提升模型对纹理、边缘的感知能力,并在CIFAR10-DVS等数据集上实现分类精度提升与脉冲发放率下降。文章以SpikingJelly框架和ResNet19为例,提供了详细的代码实现、集成步骤及参数调优实战指南。

kotlin6android的博客 609

魔百和 MG100/M101/MG101 刷机包

特点: 1、适用于对应型号的电视盒子刷机; 2、开放原厂固件屏蔽的市场安装和u盘安装apk; 3、修改dns,三网通用; 4、大量精简内置的没用的软件,运行速度提升,多出大量的存储空间; 5、去除应用安装限制; 6、支持开机自启动、开机密码锁、儿童应用锁、应用隐藏、开机自动进入HDMI等各种花式功能 。

点我主页,可查看所有固件文章! 4万+

5G NR上行控制信道PUCCH

一、PUCCH概述 PUCCH用于承载上行控制信息,相比LTE,NR PUCCH支持5种不同的格式,按照时域上所占用的符号数量可以分为短格式和长格式两种,如下表所示,短格式占用1-2个符号,可以承载1-2bit信息,长格式占用4-14个符号,可承载大于2bit的信息。NR引入短格式PUCCH的目的是可以缩短HARQ-ACK反馈的时延,长格式仍然是考虑到持续时间长可以保证覆盖。 NR中,考虑到系...

一个关于5G NR的博客^^ 3万+

显示计算机101代码,steam错误代码101怎么办_steam错误代码101的解决方法

最近有朋友问小编steam错误代码101怎么办,对于这个问题,相信还有很多朋友不明白,steam平台是很多朋友都使用过的,有的朋友发现steam出现错误代码101,服务器连接失败,的问题,为什么steam会出现错误代码101的情况呢?遇到这种情况应该如何处理呢?别着急,小编这就为大家带来steam错误代码101的解决方法。steam错误代码101的解决方法:1、当我们出现101错误的时候,并非是软...

weixin_36382534的博客 2994

EV1527、PT2262傻傻分不清?一文讲透常见315/433MHz遥控编码协议区别与选型

本文深度对比了EV1527、PT2262和SC5262三种常见的315/433MHz遥控编码协议,详细解析了它们的技术特点、成本效益和适用场景。EV1527作为低成本方案的首选,特别适合智能家居和简易安防设备;PT2262在稳定性和兼容性上表现优异;而SC5262则在安全性方面具有显著优势。文章还提供了实用的选型框架和工程建议,帮助开发者在不同应用场景中做出最优决策。

weixin_33640562的博客 354

(二)MS-MPI多机通信

1.关于MPI多机通信 一台计算机处理数据的能力是有限的,MPI的主要作用就是用来实现并行计算机,即将多台主机联机,实现大规模、高性能的计算机机群。我们知道一台计算机同时运行多个进程时,由于计算机资源是共享的,多个进程都会占用一些资源,每个进程运行的效率就会降低,比如当一台计算机同时跑着多个大型应用时会变得非常卡顿。所谓多机通信,可以理解为将本应该在同一台主机上运行的多个进程分配到多台主机上,以往...

xinwuya_的博客 4392

显示计算机101代码,steam错误代码-101 解决steam错误代码-101的方法

很多小伙伴都在steam这个平台上玩游戏,有所以难免会遇见steam错误代码-101的情况,这是什么情况呢?当我们出现-101错误的时候,并非是软件服务器的问题,而是因为我们的网络缓存出现了问题,所以导致网页访问的时候会出现101,今天小编教你们如何解决这个问题。解决steam错误代码-101的方法1、当我们出现101错误的时候,并非是软件服务器的问题,而是因为我们的网络缓存出现了问题,所以导致网...

weixin_34438539的博客 5696

nginx+keepalived高可用

两台服务器上的keepalive是靠相互通讯来判断的,如果一台服务器上keepalived挂掉了,keepalived就会把虚拟的ip就会转移到备用的nginx服务器上,实现服务转移。keepalive只能相互检查对方的进程是否还存活,所以对nginx没有任何一点监控作用,当nginx宕机后,keepalived进程还存活着就会导致web项目无法访问,所以后续需要编写一个shell脚本来完成对nginx进程的判断。在高可用架构中,Nginx 常用作前端的负载均衡器,将流量分发到多个后端服务器上。

qq_61314298的博客 3910

网络数据分析溯源(DNS服务器地址)

用wireshark打开包,用dns协议过滤 DNS服务器进行域名(domain name)和与之相对应的IP地址 (IP address)转换。DNS中保存了一张域名(domain name)和与之相对应的IP地址 (IP address)的表,以解析消息的域名。 所以只需要观察哪个ip接收到大量的域名解析的请求就可以判断了 输入172.16.200.101,得到key ...

qq_36933272的博客 1128

射频总集篇:(不断更新)

射频每一章涉及到的重点理论/设计方法 CHAPTER 1 传输线理论 输入阻抗Zin,负载阻抗ZL,驻波比ρ,反射系数 CHAPTER 2 波导 矩形波导,圆波导,同轴线 CHAPTER 3 微型带状传输线 微带线的参数设计,带状线的参数设计 CHAPTER 4 ...

jieyannn的博客 1922

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

墨者 - 网络数据分析溯源(DNS服务器地址)

输入dns命令直接过滤掉剩下dns包 最后发现172.16.200.101这个ip访问较多,因此断定为dns服务器

吃肉唐僧的博客 1078

贝叶斯统计 [韦来生编]

贝叶斯(Bayes)统计是近几十年来迅速发展起来的数理统计的一个重要分支。贝叶斯方法与经典统计方法的主要不同之处是进行统计推断时除了利用样本信息外,还要利用参数的先验信息,因此可以提高统计推断或统计决策的效果。它在经济、金融、生物、医学、自然科学和社会科学等许多领域具有广泛的应用。贝叶斯方法的研究已渗透到了统计学的几乎所有领域。作者在给中国科学技术大学概率论与数理统计专业本科生开设的“数理统计”课程中有一章专门讲授“贝叶斯方法和统计决策理论”,近十年来也给中国科学技术大学概率统计专业研究生开设过几次“贝叶斯分析”课。本书是在对过去讲稿的内容作了适当的增减和调整的基础上完成的。  本书共分六章。第1章是绪论,介绍了贝叶斯统计的若干基本概念,同时对必要的数理统计的基础知识有重点地作了回顾。第二章介绍了确定先验分布的若干可供选择的方法。第三章介绍了几类常见统计模型参数的后验分布的主要结果和计算方法。第四章和第五章分别介绍了“贝叶斯统计推断”和“贝叶斯统计决策”的内容。第六章介绍了贝叶斯统计计算的若干方法,包括蒙特卡洛方法和马尔可夫链蒙特卡洛(MCMC)方法以及相关统计软件的简介。本书的每一章附右大量的例题和习题,书末附有常用的几个表格和部分习题解答供读者查用。  大约可在54学时内讲授本书的第1章至第六章的主要内容,教师可根据学时需要选讲本书第1章至第六章的部分内容。书中标“*”号的章节可略去不讲,留给读者作为阅读材料。第六章例题中的R代码和部分例题的数据文件等可从作者个人主页下载。  作者在编写本书的过程中参考了J.O.Berger教授的《统计决策论及贝叶斯分析》和茆诗松教授编写的《贝叶斯统计》等书中的一些内容,以及《贝叶斯分析》一书中由张伟平博士编写的有关贝叶斯统计计算的一些内容。在此表示衷心感谢。  本书编写准备过程中,中国科学技术大学统计与金融系的几个研究生帮助完成了本书部分中文的录入和排版,作者对他们的辛勤工作表示真诚的感谢。高等教育出版社为本书的出版给予了大力支持。在此一并致谢。

饥荒dns服务器未响应,DNS服务器未响应怎么办

满意答案ccss123122016.08.13采纳率:47%等级:6已帮助:105人楼主您好!请手动在本地连接中设置IP地址、子网掩码、网关和DNS服务器,您的问题可能是从网关处自动获取的DNS服务器有问题,建议询问宽带供应商(电信或联通),咨询DNS服务器的IP地址。举例:局网中路由器为192.168.0.1,电脑A的IP设置为自动获取,DNS设置也是自动获取。在本地连接中改成手动设置的...

weixin_36372146的博客 1460

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

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

MAS 激活脚本怎么用:一条命令完成 Windows 与 Office 免费激活

新装的系统没有激活密钥,Windows 右下角一直挂着未激活提示,Office 也弹着功能受限提醒——这种局面,不少人都遇到过。MAS 激活脚本(Microsoft Activation Scripts)就是为这个场景准备的开源工具:不需要安装任何附加软件,Windows 激活和 Office 免费激活都可以靠一条命令跑完。下面按"先选路、再动手、最后核对"的顺序,把整套流程讲清楚。 ## 🧭

gitblog_06874的博客 154

Centos7.9主从DNS部署

Centos7.9主从DNS部署

cetrp的博客 566

system-design-101 详解:8 种常用 DNS 记录类型(A、CNAME、AAAA、MX、NS、SRV、PTR、TXT)

DNS(Domain Name System,域名系统)是互联网的"地址簿",负责把人类可读的域名(如 `google.com`)翻译成机器可读的 IP 地址(如 `142.251.46.238`)。而承载这些映射关系的核心载体,就是**DNS 记录(DNS Record)**。本文以 system-design-101 仓库中的 [dns-record-types-you-should-know

gitblog_00090的博客 327

MG100-M101-UNT400B-MG101等_Hi3798MV100_当贝纯净桌面-卡刷固件包

1、把下载好的刷机包,update.zip放入U盘中,注意升级包为压缩包不要对升级包进行解压和操作,解压后固件就废了;6、支持开机自启动、开机密码锁、儿童应用锁、应用隐藏、开机自动进入HDMI等各种花式功能;3、盒子检测到升级包后自动复制升级包后,重新启动,进行升级,切记升级过程中不要断电。4、大量精简内置的没用的软件,运行速度提升,多出大量的存储空间;

点我主页,可查看所有固件文章! 4402

DNS与DHCP实验

DNS服务器:主 192.168.137.101 从 192.168.137.102 DHCP服务器 192.168.137.101 提供192.168.137.0/24 网段的ip地址 子网掩码 默认网关 DNS服务器地址 DNS默认域名配置1.关闭防火墙,安装软件服务 2. 设置DNS配置 设置正向解析 设置反向解析启动服务 先测试主是否设置正确 同理进入/etc/named.rfc1912.zones进行配置 打开windows客户端进行测试自动获取DNS 打开另一台linux

2302_76410765的博客 532

湖北移动CM101s-Hi3798MV100-EMMC-m8214-当贝桌面卡刷强刷包

2、将bootargs.bin、fastboot.bin、recovery.img、update.zip等4个文件复制放入U盘里,然后插上拆开了的机顶盒上,用镊子短接主控芯片1-2两个管脚;6、支持开机自启动、开机密码锁、儿童应用锁、应用隐藏、开机自动进入HDMI等各种花式功能;4、大量精简内置的没用的软件,运行速度提升,多出大量的存储空间;

点我主页,可查看所有固件文章! 5026

设置ODBC的自定义类CSetODBC

何志丹一,功能描述用于配置数据源用户名及密码.1,可以得到连接串,此串可用于CMyRecordset(派生于CRecordset)的GetDefaultConnect(),也可以用干CDataBase类OpenEx.2,如果用户配置正确,只需要配置一次,相关信息记录在文件.3,可以指定存储信息的文件名.因为有可能几个程序共用一个数据源.4,用户可以重新配置数据5,可以得到当前数据的类型.6

闻缺陷则喜何志丹 3157
上一篇: MYSQL参数 DELAY_KEY_WRITE说明
下一篇: c++中vector的遍历及元素删除
dds_dev_group
博客等级 码龄15年 4粉丝 12原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值