- 博客(9)
- 收藏
- 关注
原创 AI插画师:生成对抗网络
AI插画师:生成对抗网络本文基于《深度学习框架PyTorch入门与实践》,将书中的代码进行了修改并补充了大量的注释。本文用GAN实现一个生成动漫人物头像的例子首先看本实验的代码结构:model.py文件实现模型定义,config.py文件对模型的参数进行配置,main.py文件实现训练和生成接着看model.py中定义的生成器及判别器(这里对生成器的数据进行归一化处理时采用的是LayerNorm(),书中采用的的是BatchNorm(),二者的具体区别可参考官方文档)import tor
2021-03-06 15:12:44
459
原创 Hash的应用
这类问题有一个共同点:输入的分数种类是有限的。此例中输入的数据只有101种可能,只要为这101中可能分别计数,就可以在输入结束的时候知道每一种分数的重复情况。#include <iostream>#include <algorithm>#include <string>#include <string.h>#include <stdio.h>#include <math.h>#include <cmath>..
2020-06-18 11:28:48
325
原创 日期类问题
#include <iostream>#include <algorithm>#include <string>#include <string.h>#include <stdio.h>#include <math.h>using namespace std;//判断是否为闰年int isLeapYear(int year){ if((year%4==0&&year%100!=0||year..
2020-06-18 10:57:24
181
原创 字符串内排序(九度教程第5题)
#include <iostream>#include <algorithm>#include <string>#include <string.h>#include <stdio.h>using namespace std;int main(){ char a[101]; while(gets(a)) { int len=strlen(a); if(len==0) .
2020-06-18 08:28:35
202
原创 EXCEL排序(九度教程第4题)
样例输入:3 1000007 James 85000010 Amy 90000001 Zoe 604 2000007 James 85000010 Amy 90000001 Zoe 60000002 James 984 3000007 James 85000010 Amy 90000001 Zoe 60000002 James 900 0样例输出:Case 1:000001 Zoe 60000007 James 85000010 Amy 90Case 2:000.
2020-06-18 08:18:56
291
原创 成绩排序
#include <iostream>#include <algorithm>#include <string.h>using namespace std;struct E{ char name[101]; int age; int score;}a[1000];bool cmp(E a,E b){ if(a.score!=b.score) return a.score<b.score;//分数不同分.
2020-06-17 16:55:45
324
原创 排序
冒泡排序做法:#include <iostream>using namespace std;int main(){ int n; cin>>n; int a[100]; for(int i=0;i<n;i++) { cin>>a[i]; } for(int i=0;i<n;i++) { for(int j=0;j<n-i-1;j++) .
2020-06-17 11:45:39
169
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅
4