为微软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 ...
随机推荐
- 【Spring源码分析】原型Bean实例化过程、byName与byType及FactoryBean获取Bean源码实现
原型Bean加载过程 之前的文章,分析了非懒加载的单例Bean整个加载过程,除了非懒加载的单例Bean之外,Spring中还有一种Bean就是原型(Prototype)的Bean,看一下定义方式: & ...
- CLOB型转成字符型
//oracle.sql.Clob类型转换成String类型 public static String ClobToString(Clob clob) { String reString = &quo ...
- java导出word
public void dayinHw(HttpServletRequest request, HttpServletResponse response){ String id = request.g ...
- Android学习之AutoCompleteTextView和MultiAutoCompleteTextView
转自:http://blog.csdn.net/qq_28468727/article/details/52258409 AutoCompleteTextView.MultiAutoCompleteT ...
- Redis 基础(一)
Remote Dictionary Server(Redis)是一个由Salvatore Sanfilippo写的key-value存储系统.Redis是一个开源的使用ANSI C语言编写.遵守BSD ...
- Activity 与 springMvc相整合
准备环境: springMvc框架及Activity所需要的jar: 创建spring-activity.xml文件,里面内容: <?xml version="1.0" en ...
- 小程序首页onLoad为异步,调用app.js中的全局参数的解决方案。
一,先说一下遇到的问题: 在首页,为了携带app.js中一些参数去做请求动作,但是由于异步原因,发现请求时候,参数信息还未获取到但请求已经发出去. 若等app.js的全局参数返回来,再携带着它去做请求 ...
- python web开发-flask访问请求数据request
Request对象在web应用的开发中是一个非常重要的对象,主要用来获取用户发来的请求数据. 常用属性参考:http://docs.jinkan.org/docs/flask/api.html#fla ...
- 为什么需要RPC,而不是简单的HTTP接口
转载自:http://www.oschina.net/question/271044_2155059?sort=default&p=1#answers 目前有很多Java的RPC框架,有基于J ...
- 网站转变风格的css变化
网站换肤,是一个比较老的话题了,理论很清晰,就是要根据js 来变换文件加载的css文件,根据需求来加载不同的css文件,有了这个基础就很明确要怎么做了,但是实际上还要记录当前用户的cookie 保证 ...