为微软samples-for-ai贡献代码是种怎么样的体验?
推送原文链接:传送门
还记得微软神器samples-for-ai吗?它可不仅仅可以用来安装框架,它其实是个开源的AI样例库,以Visual Stdio工程形式包装,会为微软用户学习开发AI应用带来不小的帮助。现在,Someday及其小伙伴们的代码已经被sameples-for-ai采用!我们是github上首个用Keras框架实现Progressive Growing of GANs模型的项目。该模型出自NVIDIA的研究,原论文将在ICLR 2018上发表,是目前世界上最先进的对抗生成网络模型之一。
samples-for-ai项目目前正处在收尾阶段,样例近期还会继续扩充~
Keras-progressive_growing_of_gans项目的代码的主要贡献者为:naykun、Somedaywilldo、Leext、参与者还有WJQ、WJJ。(Somedaywilldo当然是Someday的github ID了)
二话不说,先上项目地址~
微软samples-for-ai项目地址:
https://github.com/Microsoft/samples-for-ai
其中我们的贡献位于examples/keras/Progressive growing of GANs:
下面是我们的项目原地址(大本营):
https://github.com/Somedaywilldo/Keras-progressive_growing_of_gans
(求github小星星,能为大本营和samples-for-ai各点一颗就更好了嘻嘻~)
附上我们的README,README出自Someday之手,可能是目前为止Someday写的最正式的一次README:
Keras-progressive_growing_of_gans
Introduction
Keras implementation of Progressive Growing of GANs for Improved Quality, Stability, and Variation.
Developed by BUAA Microsoft Student Club.
Leader developers: Kun Yan, Yihang Yin, Xutong Li
Developers: Jiaqi Wang, Junjie Wu
Requirements
Python3
keras 2.1.2 (TensorFlow backend)
How to run
1. Clone the repository
2. Prepare the dataset
First download CelebA Dataset.
Run h5tool.py to create HDF5 format datatset. Default settings of h5tool.py will crop the picture to 128*128, and create a channel-last h5 file.
- $ python3 h5tool.py create_celeba_channel_last <h5 file name> <CelebA directory>
Modify config.py to your own settings.
- # In config.py:
data_dir = 'datasets'
result_dir = 'results'
dataset = dict(h5_path=<h5 file name>, resolution=128, max_labels=0, mirror_augment=True)
# Note: "data_dir" should be set to the direcory of your h5 file.
We only support CelebA dataset for now, you may need to modify the code in dataset.py and h5tools.py if you want to switch to another dataset.
3. Begin training!
- $ python3 train.py
In train.py:
- # In train.py:
speed_factor = 20
# set it to 1 if you don't need it.
"speed_factor" parameter will speed up the transition procedure of progressive growing of gans(switch resolution), at the price of reducing images' vividness, this parameter is aimed for speed up the validation progress in our development, however it is useful to see the progressive growing procedure more quickly, set it to "1" if you don't need it.
So far, if your settings have no problem, you should see running information like our running_log_example
4. Save and resume training weights
Parameters in train.py will determine the frequency of saving the training result snapshot. And if you want to resume a previous result, just modify train.py:
- # In train.py:
image_grid_type = 'default',
# modify this line bellow
# resume_network = None,
# to:
resume_network = <weights snapshot directory>,
resume_kimg = <previous trained images in thousands>,
5. Using main.py (optional)
We provide main.py for remote training for Visual Stdio or Visual Stdio Code users. So you can directely start the training process using command line, which will be convenient in remote job submission.
- $ python3 main.py --data_dir = <dataset h5 file directory> \
--resume_dir = <weights snapshot directory> \
--resume_kimg = <previous trained images in thousands>
Contact us
Any bug report or advice, please contact us:
Kun Yan (naykun) : yankun1138283845@foxmail.com
Yihang Yin (Somedaywilldo) : somedaywilldo@foxmail.com
Reference
Progressive Growing of GANs for Improved Quality, Stability, and Variation, Tero Karras (NVIDIA), Timo Aila (NVIDIA), Samuli Laine (NVIDIA), Jaakko Lehtinen (NVIDIA and Aalto University) Paper (NVIDIA research)
tkarras/progressive_growing_of_gans (https://github.com/tkarras/progressive_growing_of_gans
github-pengge/PyTorch-progressive_growing_of_gans (https://github.com/github-pengge/PyTorch-progressive_growing_of_gans)
License
Our code is under MIT license. See LICENSE
这个项目在上周六杀青,代码主要是naykun和Someday贡献的,复现过程异常艰难,中途曾经多次想放弃。首先作为一篇非常新的顶会论文,我们读论文、搞清模型原理就花了大量的时间,naykun甚至在火车上手写了原文翻译稿(给大佬递茶),而Someday则把原作者所有的代码都hack了一遍才把训练数据和输出结果调出来,因为不同框架的色彩channel位置不一样。项目的日常就是Someday和naykun接力debug到1点,然后Someday和naykun失眠到2点。上周这个项目配合着OO捎带电梯、冯如杯院审、蓝桥杯一起食用,味道十分酸爽。
不过,在这段艰难的过程中,Someday深深体会到了科学家的严谨和实力、单从代码上就可以看出Someday自己还差那么10年功力。
在接下来的两周中,Someday会和naykun大佬一起,用推送记录下贡献项目的这段血泪史。这两周的推送会带给你GANs(对抗生成网络)的原理(Someday翻译了GANs的开山论文),Progressive growing of GANs 的原理,以及我们从根本看不懂模型代码,到经过几次战略调整之后,逐步成功复现模型的全过程,应该会为大家带来不少的收获,希望对深度学习、对抗生成网络有兴趣的朋友们多多支持,多多转发!
(原作者生成的高清明星脸)
目前我们只支持CelebA数据集,功能也还较为单一,我们会在接下来的时间里,添加更多的数据集和功能,敬请期待!
关注SomedayWill,了解为微软项目贡献代码的始终。
为微软samples-for-ai贡献代码是种怎么样的体验?的更多相关文章
- AI框架外部用户贡献代码
AI框架外部用户贡献代码 概述 飞桨是百度自主研发的一款开源的深度学习框架,是主流深度学习框架中首个完全国产化的产品,已经在农业.医疗.林业.科研.服务等领域成功应用.无论是已入职场的深度学习从业者. ...
- 如何往Spark社区做贡献,贡献代码
随着社区正在努力准备Apache Spark的下一版本3.0,您可能会问自己“我如何参与其中?”.现在的Spark代码已经很庞大,因此很难知道如何开始自己做出贡献.Spark PMC & Co ...
- 如何为PHP贡献代码
PHP在之前把源代码迁移到了git下管理, 同时也在github(https://github.com/php/php-src)上做了镜像, 这样一来, 就方便了更多的开发者为PHP来贡献代码. 今天 ...
- 如何在github上fork一个项目来贡献代码以及同步原作者的修改
[-] 如何贡献自己的力量 如何让自己的项目与原作者的项目保持同步 作为一个IT人,通过github进行学习是最快的成长手 段.我们可以浏览别人的优秀代码.但只看不动手还是成长得很慢,因此为别人贡献代 ...
- 花20分钟写的-大白话讲解如何给github上项目贡献代码
原文地址:http://site.douban.com/196781/widget/notes/12161495/note/269163206/ 本文献给对git很迷茫的新手,注意是新手,但至少会点基 ...
- 【转】如何在github上fork一个项目来贡献代码以及同步原作者的修改 -- 不错
原文网址:http://www.cnblogs.com/astwish/articles/3548844.html 作为一个IT人,通过github进行学习是最快的成长手段.我们可以浏览别人的优秀代码 ...
- GitHub上fork一个项目贡献代码以及同步原作者的修改【转】
如何贡献自己的力量 首先你总得有自己的github帐号吧,注册一个,非常简单,只需用户名,邮箱,密码,邮箱只是用来找回密码的,不做验证.因此注册后立即能用!比如我现在新注册一个叫JsLouvre的示范 ...
- win10安装PS和AI后报代码为16的错误解决方法
win10安装PS和AI后报代码为16的错误解决方法 一.总结 一句话总结:修改兼容性和以管理员方式运行就可以了 修改兼容性 以管理员身份运行 二.PS和AI安装后报代码为16的错误解决方法介绍(转) ...
- (转)大白话讲解如何给github上项目贡献代码
转自:https://site.douban.com/196781/widget/notes/12161495/note/269163206/ 2013-03-30 22:53:55 本文献给对g ...
随机推荐
- 【CJOJ2484】【Luogu2805】最小函数值(函数最小值)
题面 Description 有n个函数,分别为F1,F2,...,Fn.定义 Fi(x)=Aix2+Bix+Ci(x∈N∗)Fi(x)=Aix2+Bix+Ci(x∈N∗) .给定这些Ai.Bi和Ci ...
- WC2006水管局长(加强)
倒过来就变成了加边 然后就直接LCT # include <stdio.h> # include <stdlib.h> # include <iostream> # ...
- [BZOJ1041] [HAOI2008] 圆上的整点 (数学)
Description 求一个给定的圆(x^2+y^2=r^2),在圆周上有多少个点的坐标是整数. Input 只有一个正整数n,n<=2000 000 000 Output 整点个数 Samp ...
- 探究c# lock
今天早上阅读前辈的代码,看到了这么一段代码,如下所示: lock("Execute") { string sqlStr = sbSQLScript.ToString(); } 看到 ...
- 15.MySQL(三)
索引类型 先创建表 mysql> CREATE TABLE test( -> id INT, -> username VARCHAR(16), -> city VARCHAR( ...
- asp.net mvc 5 关闭xss过滤
在控制器方法的头部添加 [ValidateInput(false)] 如果向mvc服务端提交带html标签的内容就会导致校验失败异常,从而得不到想要的结果,关闭的方法是在相应方法头部添加 ...
- Java最大公约数和最小公倍数的求法(辗转相除法)
这道题计算了三个数的最小公倍数 import java.util.Scanner; public class D { public static int gcd(int a,int b) { int ...
- c标准头文件
好多C语言库函数参考还是用的TC的库函数参考,因此特地把现在C语言(C99)标准库函数的24个头文件列表如下:assert.h types.h(C99) signal.h stdlib.h c ...
- 一年java工作经验的面试题总结(持续更新中)
本人是17年6月份毕业的,3月份出来实习,算起来也是工作一年了吧,金三银四,博主也考虑换一份工作,于是最近面试了几家,总结一下面试中的问题,大家一起交流学习. 第一次面试 ①说下java类的加载 ② ...
- 集群session管理问题
转自:http://book.51cto.com/art/201405/439557.htm 先来看一下什么是Session. 用户使用网站的服务,基本上需要浏览器与Web 服务器的多次交互.HTTP ...