国庆10.3

华为2022数字芯片笔试题 单选 1、ASIC开发流程中,如下环节的先后顺序是? A. RTL-> Synthesis->P&R B. Synthesis->P&R->RTL C. Synthesis->RTL->P&R D.RTL->P&R->Synthesis 2、o10换算成十进制是多少? A. 8 B.16 C.10 D.2 3、reg [7:0] mem [1:256];initial $readmemh("me.. 阅读详情

A - A CodeForces - 1042A
There are n benches in the Berland Central park. It is known that ai people are currently sitting on the i-th bench. Another m people are coming to the park and each of them is going to have a seat on some bench out of n available.

Let k be the maximum number of people sitting on one bench after additional m people came to the park. Calculate the minimum possible k and the maximum possible k.

Nobody leaves the taken seat during the whole process.

Input
The first line contains a single integer n (1≤n≤100) — the number of benches in the park.

The second line contains a single integer m (1≤m≤10000) — the number of people additionally coming to the park.

Each of the next n lines contains a single integer ai (1≤ai≤100) — the initial number of people on the i-th bench.

Output
Print the minimum possible k and the maximum possible k, where k is the maximum number of people sitting on one bench after additional m people came to the park.

Examples
Input
4
6
1
1
1
1
Output
3 7
Input
1
10
5
Output
15 15
Input
3
6
1
6
5
Output
6 12
Input
3
7
1
6
5
Output
7 13
Note
In the first example, each of four benches is occupied by a single person. The minimum k is 3. For example, it is possible to achieve if two newcomers occupy the first bench, one occupies the second bench, one occupies the third bench, and two remaining — the fourth bench. The maximum k is 7. That requires all six new people to occupy the same bench.

The second example has its minimum k equal to 15 and maximum k equal to 15, as there is just a single bench in the park and all 10 people will occupy it.

有n个长凳一开始每个长凳有一定的人数,后来又来了一堆人,问每个长凳最大人数k的最小值和最大值。
代码:

#include<iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <cstdlib>
#include <algorithm>
#define ll long long
const int MAX=1e6;
using namespace std;
int a[100+5];
int main()
{
    int n,m,maxx=-1;
    ios::sync_with_stdio(false);
    cin>>n>>m;
    int sum=0;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
        if(a[i]>maxx)
            maxx=a[i];
        sum+=a[i];
    }
    int ans1,ans2;
    ans2=maxx+m;
    sum+=m;
    if(sum%n!=0)
       ans1=sum/n+1;
    else
        ans1=sum/n;
    ans1=max(ans1,maxx);
    cout<<ans1<<" "<<ans2;
    return 0;



}

B - B CodeForces - 1042B
Berland shop sells n kinds of juices. Each juice has its price ci. Each juice includes some set of vitamins in it. There are three types of vitamins: vitamin “A”, vitamin “B” and vitamin “C”. Each juice can contain one, two or all three types of vitamins in it.

Petya knows that he needs all three types of vitamins to stay healthy. What is the minimum total price of juices that Petya has to buy to obtain all three vitamins? Petya obtains some vitamin if he buys at least one juice containing it and drinks it.

Input
The first line contains a single integer n (1≤n≤1000) — the number of juices.

Each of the next n lines contains an integer ci (1≤ci≤100000) and a string si — the price of the i-th juice and the vitamins it contains. String si contains from 1 to 3 characters, and the only possible characters are “A”, “B” and “C”. It is guaranteed that each letter appears no more than once in each string si. The order of letters in strings si is arbitrary.

Output
Print -1 if there is no way to obtain all three vitamins. Otherwise print the minimum total price of juices that Petya has to buy to obtain all three vitamins.

Examples
Input
4
5 C
6 B
16 BAC
4 A
Output
15
Input
2
10 AB
15 BA
Output
-1
Input
5
10 A
9 BC
11 CA
4 A
5 B
Output
13
Input
6
100 A
355 BCA
150 BC
160 AC
180 B
190 CA
Output
250
Input
2
5 BA
11 CB
Output
16
Note
In the first example Petya buys the first, the second and the fourth juice. He spends 5+6+4=15 and obtains all three vitamins. He can also buy just the third juice and obtain three vitamins, but its cost is 16, which isn’t optimal.

In the second example Petya can’t obtain all three vitamins, as no juice contains vitamin “C”.
有n种饮料,每种饮料都有某种维生素,求花最少的钱得到最多的维生素的最小钱数
要么ABC,要么AB和C,AC和B,BC和A,AB和BC,AB和AC,AC和BC,找出最少的花费
代码:

#include<iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <cstdlib>
#include <algorithm>
#define ll long long
#define INF 0x3f3f3f
const int MAX=1e6;
using namespace std;
int main()
{
    ios::sync_with_stdio(false);
    int a=INF,b=INF,c=INF,ab=INF,ac=INF,bc=INF,abc=INF;
    string s;
    int n,co;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>co>>s;
        if(s=="A")
            a=min(a,co);
        if(s=="B")
            b=min(b,co);
        if(s=="C")
            c=min(c,co);
        if(s=="AB"||s=="BA")
            ab=min(ab,co);
        if(s=="BC"||s=="CB")
            bc=min(bc,co);
        if(s=="AC"||s=="CA")
            ac=min(ac,co);
        if(s=="ABC"||s=="ACB"||s=="BCA"||s=="BAC"||s=="CAB"||s=="CBA")
            abc=min(abc,co);
    }
    int ans=INF;
    ans=min(ans,a+b+c);
    ans=min(ans,ab+bc);
    ans=min(ans,ab+ac);
    ans=min(ans,bc+ac);
    ans=min(ans,ab+c);
    ans=min(ans,ac+b);
    ans=min(ans,bc+a);
    ans=min(ans,abc);
    if(ans==INF)
        cout<<"-1"<<endl;
    else
        cout<<ans<<endl;

}

C - C CodeForces - 1042C
You are given an array a consisting of n integers. You can perform the following operations with it:

1.Choose some positions i and j (1≤i,j≤n,i≠j), write the value of ai⋅aj into the j-th cell and remove the number from the i-th cell;
2.Choose some position i and remove the number from the i-th cell (this operation can be performed no more than once and at any point of time, not necessarily in the beginning).
The number of elements decreases by one after each operation. However, the indexing of positions stays the same. Deleted numbers can’t be used in the later operations.

Your task is to perform exactly n−1 operations with the array in such a way that the only number that remains in the array is maximum possible. This number can be rather large, so instead of printing it you need to print any sequence of operations which leads to this maximum number. Read the output format to understand what exactly you need to print.

Input
The first line contains a single integer n (2≤n≤2⋅105) — the number of elements in the array.

The second line contains n integers a1,a2,…,an (−109≤ai≤109) — the elements of the array.

Output
Print n−1 lines. The k-th line should contain one of the two possible operations.

The operation of the first type should look like this: 1 ik jk, where 1 is the type of operation, ik and jk are the positions of the chosen elements.

The operation of the second type should look like this: 2 ik, where 2 is the type of operation, ik is the position of the chosen element. Note that there should be no more than one such operation.

If there are multiple possible sequences of operations leading to the maximum number — print any of them.

Examples
Input
5
5 -2 0 1 -3
Output
2 3
1 1 2
1 2 4
1 4 5
Input
5
5 2 0 4 0
Output
1 3 5
2 5
1 1 2
1 2 4
Input
2
2 -1
Output
2 2
Input
4
0 -10 0 0
Output
1 1 2
1 2 3
1 3 4
Input
4
0 0 0 0
Output
1 1 2
1 2 3
1 3 4
Note
Let X be the removed number in the array. Let’s take a look at all the examples:

The first example has, for example, the following sequence of transformations of the array: [5,−2,0,1,−3]→[5,−2,X,1,−3]→[X,−10,X,1,−3]→ [X,X,X,−10,−3]→[X,X,X,X,30]. Thus, the maximum answer is 30. Note, that other sequences that lead to the answer 30 are also correct.

The second example has, for example, the following sequence of transformations of the array: [5,2,0,4,0]→[5,2,X,4,0]→[5,2,X,4,X]→[X,10,X,4,X]→ [X,X,X,40,X]. The following answer is also allowed:

1 5 3
1 4 2
1 2 1
2 3
Then the sequence of transformations of the array will look like this: [5,2,0,4,0]→[5,2,0,4,X]→[5,8,0,X,X]→[40,X,0,X,X]→ [40,X,X,X,X].

The third example can have the following sequence of transformations of the array: [2,−1]→[2,X].

The fourth example can have the following sequence of transformations of the array: [0,−10,0,0]→[X,0,0,0]→[X,X,0,0]→[X,X,X,0].

The fifth example can have the following sequence of transformations of the array: [0,0,0,0]→[X,0,0,0]→[X,X,0,0]→[X,X,X,0].
题意:有两种操作,一种是1 a b,给第b个数赋上a×b的值,把第a个数删去;另一种是2 a,把第a个数删除。最后数组内只剩一个最大的数,把这些操作输出,只输出其中一种。
当有0的时候,如果有奇数个负数,就把所有的0整合到一起,并把最大的负数整合到0上,然后把这个0删除,如果有偶数个负数,就只把所有0整合到一起然后删掉。
当没有零的时候,如果有负数个奇数,就删掉最大的奇数,如果有偶数个就不需要删除。

代码:

#include<iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <cstdlib>
#include <algorithm>
#define ll long long
#define INF 0x3f3f3f3f
const int MAX=1e6;
using namespace std;
int a[200000+10];     //存输入的这些数
int w0[200000+10];    //记录0的位置
int main()
{
    int n;
    ios::sync_with_stdio(false);
    int d=0,sum=0,k=0;
    int maxx=-INF;
    scanf("%d",&n);
    for(int i=1; i<=n; i++)
    {
        scanf("%d",&a[i]);
        if(a[i]<0)
        {
            d++;
            if(a[i]>maxx)
                maxx=a[i],k=i;
        }
        if(a[i]==0)
            w0[++sum]=i;
    }
    if(sum!=0)
    {
        if(d%2!=0)
        {
                w0[++sum]=k;      //把最大负数也改成0并且放到w0数组
                a[k]=0;     
        }
    }
    else
    {
        if(d%2!=0)
        {
           printf("2 %d\n",k);
           a[k]=0;
        }
    }

    for(int i=1;i<sum;i++)       //把所有0和到一个位置
        printf("1 %d %d\n",w0[i],w0[i+1]);
    if(sum!=0&&sum!=n)      //特判一下全为0和只有0和一个负数时不删除这个数
            printf("2 %d\n",w0[sum]);
    int t;
    for(int i=1;i<=n;i++)
        if(a[i]!=0)
        {
            t=i;
            break;
        }

    for(int i=t+1;i<=n;i++)
    {
        if(a[i]!=0)
            printf("1 %d %d\n",t,i),t=i;
    }
    return 0;

}

D - D CodeForces - 1051A
Vasya came up with a password to register for EatForces — a string s. The password in EatForces should be a string, consisting of lowercase and uppercase Latin letters and digits.

But since EatForces takes care of the security of its users, user passwords must contain at least one digit, at least one uppercase Latin letter and at least one lowercase Latin letter. For example, the passwords “abaCABA12”, “Z7q” and “3R24m” are valid, and the passwords “qwerty”, “qwerty12345” and “Password” are not.

A substring of string s is a string x=slsl+1…sl+len−1(1≤l≤|s|,0≤len≤|s|−l+1). len is the length of the substring. Note that the empty string is also considered a substring of s, it has the length 0.

Vasya’s password, however, may come too weak for the security settings of EatForces. He likes his password, so he wants to replace some its substring with another string of the same length in order to satisfy the above conditions. This operation should be performed exactly once, and the chosen string should have the minimal possible length.

Note that the length of s should not change after the replacement of the substring, and the string itself should contain only lowercase and uppercase Latin letters and digits.

Input
The first line contains a single integer T (1≤T≤100) — the number of testcases.

Each of the next T lines contains the initial password s (3≤|s|≤100), consisting of lowercase and uppercase Latin letters and digits.

Only T=1 is allowed for hacks.

Output
For each testcase print a renewed password, which corresponds to given conditions.

The length of the replaced substring is calculated as following: write down all the changed positions. If there are none, then the length is 0. Otherwise the length is the difference between the first and the last changed position plus one. For example, the length of the changed substring between the passwords “abcdef” → “a7cdEf” is 4, because the changed positions are 2 and 5, thus (5−2)+1=4.

It is guaranteed that such a password always exists.

If there are several suitable passwords — output any of them.

Example
Input
2
abcDCE
htQw27
Output
abcD4E
htQw27
Note
In the first example Vasya’s password lacks a digit, he replaces substring “C” with “4” and gets password “abcD4E”. That means, he changed the substring of length 1.

In the second example Vasya’s password is ok from the beginning, and nothing has to be changed. That is the same as replacing the empty substring with another empty substring (length 0).
代码:

#include<iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <map>
#include <cstdlib>
#include <algorithm>
#define ll long long
#define INF 0x3f3f3f3f
const int MAX=1e6;
using namespace std;
int main()
{
    string s[105];
    int t;
    int a[4];
    ios::sync_with_stdio(false);
    cin>>t;

    for(int i=1; i<=t; i++)
    {
        cin>>s[i];
        memset(a,0,sizeof(a));
        int flag=0;
        int n=s[i].size();
        for(int j=0; j<n; j++)
        {
            if(s[i][j]>='a'&&s[i][j]<='z')
                a[0]++;
            if(s[i][j]>='A'&&s[i][j]<='Z')
                a[1]++;
            if(s[i][j]>='0'&&s[i][j]<='9')
                a[2]++;
        }
        //cout<<a[0]<<a[1]<<a[2]<<endl;
        if(a[1]&&a[2]&&a[0])
        {
           cout<<s[i]<<endl;
            continue;
        }
        if(a[0]==0)
        {
            if(a[1]>=2)
            {
                for(int k=0; k<n; k++)
                    if(s[i][k]>='A'&&s[i][k]<='Z')
                    {
                        s[i][k]='a';
                        flag=1;
                        break;
                    }
            }
            if(!flag)
            {
                for(int k=0; k<n; k++)
                    if(s[i][k]>='0'&&s[i][k]<='9')
                    {
                        s[i][k]='a';
                        break;
                    }
            }
        }
        flag=0;
        if(a[1]==0)
        {
            if(a[0]>=2)
            {
                for(int k=0; k<n; k++)
                    if(s[i][k]>='a'&&s[i][k]<='z')
                    {
                        s[i][k]='A';
                        flag=1;
                        break;
                    }
            }
            if(!flag)
            {
                for(int k=0; k<n; k++)
                    if(s[i][k]>='0'&&s[i][k]<='9')
                    {
                        s[i][k]='A';
                        break;
                    }
            }
        }
        flag=0;
        if(a[2]==0)
        {
            if(a[1]>=2)
            {
                for(int k=0; k<n; k++)
                    if(s[i][k]>='A'&&s[i][k]<='Z')
                    {
                        s[i][k]='0';
                        flag=1;
                        break;
                    }
            }
            if(!flag)
            {
                for(int k=0; k<n; k++)
                    if(s[i][k]>='a'&&s[i][k]<='z')
                    {
                        s[i][k]='0';
                        break;
                    }
            }
        }
        cout<<s[i]<<endl;

    }
    return 0;

}
EDA环境下的LSF进阶调优:如何为Cadence/VCS等工具正确配置cgroups与daemon starter 本文深入探讨了在EDA环境中如何为Cadence/VCS等工具正确配置LSF的cgroups与daemon starter,解决资源分配与特殊应用兼容性问题。通过详细解析cgroups技术、daemon starter配置及混合资源管理策略,帮助提升LSF集群的效率和稳定性,特别适用于高性能计算和芯片设计场景。 阅读详情

相关推荐

第 3 天:Actor 是什么?创建你的第一个游戏对象!

本文详细介绍 Actor 在 Unreal Engine 5 中的作用,并通过 C++ 创建你的第一个游戏对象。你将学习 Actor 的生命周期(BeginPlay、Tick)、如何添加组件(Static Mesh),并让 Actor 在游戏世界中运作。同时提供 常见问题解决方案,助你快速上手 UE5 C++ 开发!🎮 跟随本教程,构建属于你的第一个游戏对象!

m0_37643873的博客 2647

"巴卡斯杯" 中国大学生程序设计竞赛 - 女生专场(重现)解题思路

"巴卡斯杯" 中国大学生程序设计竞赛 - 女生专场(重现)解题思路

queuelovestack的专栏 1万+

光耦继电器电路分析

光耦电路的分析笔记

MingYue_SSS的博客 6921

HDU 4923 Room and Moor (数学+单调栈)

HDU 4923 Room and Moor (数学+单调栈)

Tc的专栏 1091

保姆级教程:用OpenCV和MediaPipe在Python里实现实时手势识别(附完整代码)

本文提供了一份详细的Python教程,教你如何使用OpenCV和MediaPipe实现实时手势识别系统。从环境配置、手部关键点检测到手势分类算法,逐步讲解如何构建高精度手势识别应用,适用于智能家居控制、PPT操作等场景。教程包含完整代码示例和性能优化技巧,特别适合计算机视觉初学者和开发者实践。

weixin_28677005的博客 340

[Ethernet in CANoe]3--CANoe工程中SOME/IP报文的详细介绍(一)

和上述第一章节的介绍,我们对SOEMIP通信协议有了初步了解,首先我们先暂停Trace窗口,可以看到整个Trace窗口关于SOMEIP的报文有两种颜色,一种是紫色,另一种是绿色。它使用多播地址,允许服务提供者发布其服务,服务消费者订阅这些服务。上述每点开一个SOMEIP报文,左侧的details就能看到该报文中的具体细节,从IP地址到port口,再到具体的serviceID,都能详细的解析。一旦通过服务发现完成了服务的发布和订阅,服务消费者就可以向服务提供者发送请求,或者服务提供者向消费者发送事件通知。

汽车ECU自动化测试 1418

密码等级:至少包含字母、大小写数字、特殊字符 JS

前言 密码,如果设置的太简单,很容易就被攻破,所以很多网站将密码设置的要求设置的挺严格,一般是字母、数字、字符3选2,区分大小写。对于设置得太简单的密码,予以错误提示。或者予以密码等级(低中高)显示,让用户设置高级密码。那如何利用JS实现呢? 代码 链接:https://gist.github.com/xuanfeng/a44f20cb4569d5b4cd5e   1 2...

金溪的博客 1万+

VGG16

VGG16学习笔记

一去不复返的通信er 1185

国庆训练10.3

国庆训练10.3the first one题面思路源码 the first one 题面 [HAOI2008]圆上的整点 时间限制:10秒 内存限制:162MB 题目描述 求一个给定的圆(x2+y2=r^2),在圆周上有多少个点的坐标是整数。 输入 Each input will begin with a line with a single integer W (1≤W≤105 ), which...

tangtanghhh的博客 245

银河麒麟系统V10 Server SP1 安装Oracle 19c

•oracle-database-preinstall-19c 这个工具会自动配置系统参数,创建 oracle 用户和组。比较方便。•••••银河麒麟高级服务器操作系统V10 - 国产操作系统、银河麒麟、中标麒麟、开放麒麟、星光麒麟——麒麟软件官方网站。

fuguimashu的博客 4335

11、频率响应与伯德图详解

本文详细介绍了电子电路分析中的频率响应与伯德图,涵盖分贝的定义与计算、带宽与3dB点、放大器反馈机制、倍频程与十倍频程概念,并系统讲解了基于实数和复数零极点的伯德图构建方法。通过具体示例分析了传递函数的渐近近似、幅度与相位响应,并结合MATLAB工具展示了伯德图的绘制过程。文章旨在帮助读者深入理解电路在不同频率下的行为特性,为电路设计与优化提供理论支持。

white的博客 175

国庆博客10.3-10.7

2.所指是const [const在*前] const int*p=&I (*p)是const,i可再赋值,p可再取地址,但*p不可变 在函数之前引入数组时const,使函数不对你的数组进行修改。P78数组运算 数组集成的初始化:*int a[]={[1]=2,[5]=6};*p——>ac[0],则*(p+1)——>ac[1] *p++为先取出数据,后将p移至下一位。//向标准输出写一个字符,返回写了多少个字符,EOF(-1)表示写失败。

OscarMiao的博客 466

CVE-2021-22205 GITLAB 未授权 RCE 漏洞

简介 GitLab是由GitLab Inc.开发的一个用于仓库管理系统的开源项目,使用Git作为代码管理工具,可通过Web界面访问公开或私人项目。由于GitLab存在未授权的端点,导致该漏洞在无需进行身份验证的情况下即可进行利用。 漏洞利用 上工具 python3 poc import sys import requests from bs4 import BeautifulSoup requests.packages.urllib3.disable_warnings() def .

qq_32445755的博客 890

百脑汇 Ghost_XP_SP3 电子城国庆版 2012.10

百脑汇 Ghost_XP_SP3 电子城国庆版 2012.10 文件: BNH_GHOSTXP_SP3_12.10.iso大小: 728154112 字节(694.42M)修改时间: 2012年9月20日, 21:14:13MD5: 6E39A26B5500AC4DEF18A5F5771345B3SHA1: E5A977FC4D0E90205358D8FCEA58B58C6D...

weixin_34198797的博客 169

IMSL CNL 7.0.0 (x86-64)Crack

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

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

10-3 国庆笔记

测试用力 测试用力是根据需求文档进行编写 接口测试 1、手动(postman) 2、代码形式(通过测试脚本进行执行,具有一定的自动化成度) 接口文档4个重点 请求地址、发送请求的格式、返回结果,请求方式 接口测试用力(大多数用到等价类)(参考接口文档来写。而不是根据需求文档写) 执行用例 缺陷报告 开发写完就可以测试 postman测试接口 ...

SONY222的博客 107

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

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

国庆作业10.3

【代码】国庆作业10.3。

HYL1234511的博客 144

廖雪峰Python教程[完整版]

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

国庆训练 10.3

过了好几天了,还有好多题要补,先更个博客,万一过几天就忘光了。。。 Kattis artwork 先把格子填满,记录填充数目,然后倒着做,当某个格子变为0的时候,就和四周能合并的格子合并。 1 #include <bits/stdc++.h> 2 using namespace std; 3 4 int n,m,q; 5 struct node{ ...

weixin_30869099的博客 123

中国象棋国庆实现

国庆用了3天10小时实现的,现在先放几张图片

wafer_biscuit的博客 194

12月份参加工作的年假怎么休_【安排!】明年五一连休5天,请3休9?国庆请2休10!春节请3休11!只求......拼假日历...

明年假期官宣昨晚,被这个消息刷屏了,一年一度,在11月底这几天都会官宣第二年的假期安排,今年还稍早一些,全面出炉了!不过和往年相比,看完日历,我们的第一感觉是:祈祷明年一切平平安安,疫情得到控制!不奢望出国玩,每一个假期,每一个周末,大家能顺顺利利的把各种随心飞,各种假期计划开心的执行完,玩转祖国大好河山!就是最幸福的事了!其实我们10月份,已经预测过2021年的拼假旅行日历,昨天看了...

weixin_42118701的博客 389

国庆朋友聚会10.3

    昨天同学聚会meet了很多许久没有见过老同学:阿桂、怪头、李树晓、大陈、郑义彪、豆张军、银鑫、赵凯和最佳partner weiasd,活动也是丰富多彩。下午打了两三个小时的篮球,一年多没有摸过了,不过以前也不会玩。大家见面都显得非常;玩篮球的时候人陆续的到齐,竟然有17个之多。晚上6点的时候去了附近新开的小毛驴火锅,味道还真是不错。聊天中发现李树晓成了师弟,怪头学会了着色笑话,胖子也有很多

yesterday today tommorrow 1102

10.3国庆作业(UART实验)

完成UART实验:实现串口工具输入一个字符串,按下回车键,会显示输入的字符串

qq_55853947的博客 7350

10.1~10.3国庆节技术沉淀

国庆节没怎么学习,玩了一天,宿舍玩游戏两天 一次循环完成百钱白鸡,关键就在于先人工化简一下两个方程式。 23456789的各位之和怎么求?现在也不会 好吧,现在会了,不太理解: /** * 求整数各位之和 * @author zlb * @date 10.3 */ //import java.util.Scanner; public class BigNumber{ public static void main(String [] args) { //输入一个整数 //Scann

m0_46663240的博客 159

10.3-国庆-作业

【代码】10.3-国庆-作业。

m0_72775916的博客 249

电脑公司 Ghost XP SP3 国庆特别版 v2011.10

电脑公司 Ghost XP SP3 国庆特别版 v2011.10 文件名称:DNGS_GhostXpSp3_v2011.10.iso文件大小:686.59MB (719,945,728字节)系统格式:NTFSCRC32:DDEBC170MD5:FA264E6241154EE7F80EFED3CFF1C6A2SHA1:FFEB1C13854AA954D9EE384153815F...

weixin_33842304的博客 589

10.19 qbxt国庆day3

最近的题都莫名简单 经常AK 炼金术 【问题描述】 即使是最伟大的ACM选手也是需要足够的金钱来把妹的的。于是ZYB发明了一台炼金机器. 这台机器一共有三个功能: 1.能把a位沙子变成b位石油. 2.能把c位石油变成d位金子. 3.能把e位金子变成f位沙子. 值得注意的是你并不需要用整单位的物品进行兑换,例如你可以利用0.1 沙子来兑换0.1 石油。 然而现在ZYB里手只有10^100的沙子,他想...

weixin_30510153的博客 179
上一篇: 国庆10.6
下一篇: 组队赛(第七周)
Dband
博客等级 码龄9年 58粉丝 119原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值