0

Keras, 网络架构

 2 years ago
source link: http://antkillerfarm.github.io/ai/2018/01/23/keras.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Keras

Keras是深度学习的前端框架的集大成者,其后端可支持tensorflow、cntk、theano等。

所谓DL前端框架一般只提供对于DL的高层抽象和封装,至于具体的运算则由具体的后端来实现。

https://keras.io/

官方中文版文档:

https://keras.io/zh/

https://github.com/keras-team/keras

https://github.com/keras-team/keras/blob/master/examples/

sudo pip install keras

https://mp.weixin.qq.com/s/2VoTmFJshvIq2Wc0Ko0iaA

使用TensorFlow和Keras实践机器学习和深度学习

https://github.com/Ahmkel/Keras-Project-Template

本项目是一个基于Keras库的项目模板,模板能让你更容易地构建和训练深度学习模型,并支持Checkpoints和TensorBoard。

模型文件处理

Keras的模型文件以HDF5的格式保存:

model.save('my_model.h5')

这里的model可以是未训练,甚至是未初始化weight的。

https://morvanzhou.github.io/tutorials/machine-learning/keras/3-1-save/

Keras:Save & reload 保存提取

h5 -> pb

可以使用如下工具:

https://github.com/amir-abdi/keras_to_tensorflow

python3 keras_to_tensorflow.py -input_model_file model.h5

Lambda层

Lambda层用以对上一层的输出施以任何Theano/TensorFlow表达式,这是一个添加自定义Layer的最简单的办法。

模型可视化

from keras.utils import plot_model
plot_model(model, to_file='model.png')

实战GAN

最近实战了一下GAN,主要参考了以下文章:

https://myurasov.github.io/2017/09/24/wasserstein-gan-keras.html

Wasserstein GAN in Keras

它的中文版:

http://mp.weixin.qq.com/s/F2gBP23LCEF72QDlugbBZQ

详解如何使用Keras实现Wassertein GAN

这是另一个GAN实现:

https://github.com/lukedeo/keras-acgan/blob/master/mnist_acgan.py

应该说GAN的训练,的确是一件非常麻烦,且有相当不确定性的事情。我试了若干版本的示例之后,才终于训练成功。

我的代码示例:

https://github.com/antkillerfarm/antkillerfarm_crazy/blob/master/python/ml/keras/hello_gan1.py

由于这里的随机因素实在太多,训练失败有时也许并不是代码的问题,即使成功也往往在数十epoch之后,计算量实在太大。我自己的示例用GTX 1080跑了11个小时。

Auto-Keras

Google AutoML的一个开源对手。

https://autokeras.com/

https://github.com/jhfjhfj1/autokeras

https://mp.weixin.qq.com/s/tyWUxJndljOSZT1-aYPgeg

Keras入门必看教程

https://kexue.fm/archives/5765

让Keras更酷一些!Keras模型杂谈

https://mp.weixin.qq.com/s/4Nz2e_vNYgq_y01JFneSfw

“让Keras更酷一些!”:分层的学习率和自由的梯度

https://mp.weixin.qq.com/s/H-oAETObn0SLUxK8–xudg

Keras+OpenAI强化学习实践:行为-评判模型

https://mp.weixin.qq.com/s/2lcOfU3X27YYqbWS341jcg

Keras+OpenAI强化学习实践:深度Q网络

http://mp.weixin.qq.com/s/kvQlzafLAn_8YgBmib3P0g

手把手教你在Amazon EC2上安装Keras

http://mp.weixin.qq.com/s/sQKhopzS4EOcYwjrM8E7xQ

十分钟搞定Keras序列到序列学习

https://mp.weixin.qq.com/s/PR5gQYEse9KxhSkEVglRWg

用Keras实现seq2seq学习

https://mp.weixin.qq.com/s/0Rdet35LHAXQJuo-r_THXg

如何为LSTM重新构建输入数据(Keras)

https://mp.weixin.qq.com/s/TGjfd3ahYSH_QYX_2j0DqQ

基于Keras的LSTM多变量时间序列预测

https://mp.weixin.qq.com/s/GqaXADRE7Hvxr-6-QapMIg

你必须知道的keras中最常用的深度学习的API

https://mp.weixin.qq.com/s/KE_zk7e6cf5ah303ZTpuMw

如何用Keras为序列预测问题开发复杂的编解码循环神经网络?

https://mp.weixin.qq.com/s/dbZLsWV3pDz3NQPc2aJAUw

用Keras开发字符级神经网络语言模型

https://mp.weixin.qq.com/s/J0pBoNpzj-GYjI-9qefkRg

7步掌握基于Keras的深度学习

https://mp.weixin.qq.com/s/HKOmDltonNpp8DftH7Goww

基于Keras的知识图谱处理实战

https://mp.weixin.qq.com/s/MvEgH-xgNk51qcdlnCJgiQ

Keras教程:用Encoder-Decoder模型自动撰写文本摘要

https://mp.weixin.qq.com/s/ktp4yfxHMt3103QzYhELrg

从头开始在Python中开发深度学习字幕生成模型

https://mp.weixin.qq.com/s/fHuHICI-_xAXIOkV0abpPg

仅需15分钟,使用OpenCV+Keras轻松破解验证码

https://mp.weixin.qq.com/s/I7IUFRVucnJLbGaTqGIXXw

如何使用Keras集成多个卷积网络并实现共同预测

https://mp.weixin.qq.com/s/2jPk3jg7AoNilErAZOaTOQ

输验证码输到崩溃?教你15分钟黑掉全球最流行的验证码插件

https://github.com/yanpanlau/DDPG-Keras-Torcs

Using Keras and Deep Deterministic Policy Gradient to play TORCS

https://mp.weixin.qq.com/s/qbyfErK7IC2tx7uJfzCg2g

seq2seq模型实例:用Keras实现机器翻译

https://mp.weixin.qq.com/s/SfambWzLry2IYRPklYk6Bw

利用TensorFlow和Keras进行比特币价格预测

https://mp.weixin.qq.com/s/tGkKNEAM6Ze1iEdqB9zzXQ

Keras:基于SegNet和U-Net的遥感图像语义分割

https://mp.weixin.qq.com/s/cvEkUBsPUmViHf5demFhtA

如何从零开始用Keras开发一个机器翻译系统!

https://mp.weixin.qq.com/s/13wS8jOZxHQ7J59Q8LvMOw

17种GAN变体的Keras实现请收好

https://mp.weixin.qq.com/s/3y-9R83Aw0Kj7qBma8x0DQ

Batch Normalization: 如何更快地训练深度神经网络

https://mp.weixin.qq.com/s/bpZ9iDf3hD7U3j2qIQi-wQ

10分钟入门Keras指南

https://mp.weixin.qq.com/s/xUPrv1ju1M9TmHbqgQBn7Q

用Python实现类FaceID的人脸识别?一文告诉你该怎么做

https://mp.weixin.qq.com/s/cmBlGiu-ATHAorYCoQhMBg

RNN-LSTM的Keras实现:以预测比特币和以太坊价格为例

https://mp.weixin.qq.com/s/_B_WaHJyH-JPS2izq_DuFg

如何使用LSTM在Keras中快速实现情感分析任务

https://mp.weixin.qq.com/s/NZErOUOeD7FidM98NlT2hQ

教你使用Keras一步步构建深度神经网络:以情感分析任务为例

https://mp.weixin.qq.com/s/uOP-VT_ITufMEW16hKRweA

手把手教你用RNN做情感分析

https://mp.weixin.qq.com/s/kIrmFLn3g-JlW74DAt4hEg

Python新玩法!如何自己动手实现FaceID功能

https://mp.weixin.qq.com/s/VmjaTzzPNXAQicFqhVM1RQ

Keras/监督学习15分钟搞定最新深度学习车牌OCR

https://mp.weixin.qq.com/s/_Kh9ZMLmAfcACVYxt02lqA

如何利用深度学习写诗歌

https://mp.weixin.qq.com/s/yzYRMLYKEwHMGjsmYzFLAw

在Keras上实现GAN:构建消除图片模糊的应用

https://mp.weixin.qq.com/s/wlJaBaKj8mET43e7c0GpLw

textgenrnn:只需几行代码即可训练文本生成网络

https://mp.weixin.qq.com/s/aZPlDOICUsXDZer0jSa65A

使用Keras和CNN构建分类器

https://mp.weixin.qq.com/s/8KDJE3MVyBMs4fUMEX7bHQ

基于Keras的注意力机制实战

http://mp.weixin.qq.com/s/1UDKVasluMpPiteysmEx1A

深度学习必备—用Keras和直方图均衡化—数据增强

https://mp.weixin.qq.com/s/bSWatfZqkvdcXJQop4LMxw

TensorFlow快餐教程:程序员快速入门深度学习五步法

https://mp.weixin.qq.com/s/eoSpoeNpKwKSouMgrA70xQ

用Python语言模型和LSTM做一个Drake饶舌歌词生成器

https://mp.weixin.qq.com/s/rVliMXPCYU4rTKU8i-gxtQ

如何用50行代码构建情感分类器

https://mp.weixin.qq.com/s/Cbpm7oMmRMC60p5_uzbn7Q

无需数学背景!谷歌研究员为你解密生成式对抗网络

https://mp.weixin.qq.com/s/u-Yq5MR0h7SDwxORZ0zQ-w

Keras vs PyTorch:谁是“第一”深度学习框架?

https://mp.weixin.qq.com/s/uFe0gQ2pxxfG-cHCZ38O_Q

手把手教你用Keras实现LSTM预测英语单词发音

https://mp.weixin.qq.com/s/sDeh0Oqqs6ERJ4Hz5ROA5Q

DeepMind重磅:神经算术逻辑单元,Keras实现

https://mp.weixin.qq.com/s/VmHckiVzz6oAvuHgyWkeUg

使用Keras实现多输出分类:用单个模型同时执行两个独立分类任务

https://mp.weixin.qq.com/s/kHX6GQ_HT2L58f49afWijA

手把手教你用keras–CNN网络识别cifar10

https://mp.weixin.qq.com/s/7tQOZcLmHYaztGGpZ-vt2Q

Keras和TensorFlow之争何时休?

https://mp.weixin.qq.com/s/caVN0570nzNXdXXYfxSNzA

五个很厉害的CNN架构

https://mp.weixin.qq.com/s/zznSbNqXBflecK7eHHT4Tg

基于迁移学习实现花卉图像分类

https://mp.weixin.qq.com/s/iDYhXUDlxeG_vOpxO5eIyQ

用Keras实现图书推荐系统

https://mp.weixin.qq.com/s/UvR7rLXV8V_QAzLOEOTg2Q

如何在网上选到一瓶心仪的红酒?通过文本分析预测葡萄酒的质量

https://mp.weixin.qq.com/s/xXbyBvxM2HOzHedztpu1Wg

Keras的可视化训练

https://mp.weixin.qq.com/s/K9U3GCW1tAIYRoKKq_nG9w

一行TensorFlow/Keras代码解决真实场景中数据不平衡(imbalanced)问题

https://mp.weixin.qq.com/s/TJhes2vp5SfkAdHXbBsiXA

用CNN做NLP文本分类竞赛

https://mp.weixin.qq.com/s/RdrUlu6hBEuIu2VepeiC-Q

CV+NLP,使用tf.Keras构建图像搜索引擎

https://mp.weixin.qq.com/s/ksCWLX_cb9wkgAN35hjL3g

使用Keras Tuner调节超参数

https://www.pyimagesearch.com/2018/06/04/keras-multiple-outputs-and-multiple-losses/

一个多输出+多Loss的示例

简单来说,Linux Virtual Server就是把一个集群虚拟成一台机器。

http://www.linuxvirtualserver.org/zh/lvs1.html

章文嵩博士的LVS经典论文,非常值得一读。

LVS的代码已经集成进Linux内核,在net/netfilter/ipvs目录下。

http://www.cnblogs.com/xybaby/p/7867735.html

关于负载均衡的一切:总结与思考

网络虚拟化

网络虚拟化是一个相反的过程,即将一台机器虚拟成一个集群。

它和LVS不是相对的概念,而是相辅相成的:

1.对于用户来说,无论多大的集群,用起来都像一台机器一样。

2.对于集群内部来说,资源调度的颗粒度,从单台机器下移到单个实例(服务/VM/容器)。

这里的内容较多,仅列出关键术语,备查。

Software Defined Network,SDN

Open vSwitch,OVS

Overlay,顾名思义,上层的,或者说,业务层面的、用户层面的,overlay traffic 是指用户业务流量。

而与overlay所对应的是underlay,顾名思义,下层的,或者说,基础架构层,专门用于承载用户流量的传统的IP网络,只要可以提供IP包的转发即可。

leaf-spine

https://mp.weixin.qq.com/s/blU7ewaKiQowV8Yju5J4lA

云计算时代携程的网络架构变迁

https://mp.weixin.qq.com/s/zuTgPlNSUpUBp8eZUFMbPA

OpenStack的架构详解

https://www.cnblogs.com/bakari/p/8037105.html

网络虚拟化

https://www.cnblogs.com/bakari/p/8097439.html

从Bridge到OVS,探索虚拟交换机

https://zhuanlan.zhihu.com/p/29881248

数据中心网络架构浅谈(一)

https://zhuanlan.zhihu.com/p/29975418

数据中心网络架构浅谈(二)

https://zhuanlan.zhihu.com/p/30119950

数据中心网络架构浅谈(三)

https://zhuanlan.zhihu.com/p/64445886

数据中心网络架构浅谈(四)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK