keras 源码调试

本文介绍了如何通过深入Keras源码来更好地理解这个深度学习框架。作者建议通过配置新的Python环境,安装并测试Keras及Tensorflow,然后从GitHub获取源码,并在VSCode中进行调试。这个过程旨在帮助读者不仅学会Keras的使用,还能洞察其内部工作原理。

深度学习从2012开始火起来到现在已经有6年了,这些年里涌现了非常多的创新的网络模型,推动了计算机视觉、自然语言处理等多个领域的长足发展。不仅如此,还诞生了一批优秀的深度学习开源框架,极大的便利了想法到实现的过程。Tensorflow、keras、pytorch等开源框架越来越成熟和强大。
虽然网络上有非常多的学习教程,但是我认为学会一个工具的最直接最有效的方法就是深入源码,去理解深度学习开源框架的构建逻辑。keras是一个构建于tensorflow、CNTK和Theano的高层框架,源码都是Python写的,使用起来很方便,源码也容易看懂,所以我打算深入Keras源码,一探究竟。
下面是我成功配置好keras环境,并实现源码调试的过程,记录下来,给大家一个参考。
其实方法很简单,简单到一看就懂。

1.使用anaconda创建一个新的环境(推荐Python3.6),正常安装好keras和tensorflow,过程中会自动安装numpy、scipy、hdf5等依赖
(我喜欢用tensorflow做keras的backend,而且也是keras默认的)

conda create -n py36_test python=3.6 

2.测试keras功能正常后,卸载keras
测试keras,确保第三方依赖库都安装好了
卸载keras是因为一会儿要用本地keras代码,不再使用pip预编译版本
3.从github下载keras源码

git clone git@github.com:keras-team/keras.git
图书可以从下面的链接下载 http://download.youkuaiyun.com/detail/u013003382/9832573 Deep Learning with Keras by Antonio Gulli English | 26 Apr. 2017 | ASIN: B06Y2YMRDW | 318 Pages | AZW3 | 10.56 MB Key Features Implement various deep-learning algorithms in Keras and see how deep-learning can be used in games See how various deep-learning models and practical use-cases can be implemented using Keras A practical, hands-on guide with real-world examples to give you a strong foundation in Keras Book Description This book starts by introducing you to supervised learning algorithms such as simple linear regression, the classical multilayer perceptron and more sophisticated deep convolutional networks. You will also explore image processing with recognition of hand written digit images, classification of images into different categories, and advanced objects recognition with related image annotations. An example of identification of salient points for face detection is also provided. Next you will be introduced to Recurrent Networks, which are optimized for processing sequence data such as text, audio or time series. Following that, you will learn about unsupervised learning algorithms such as Autoencoders and the very popular Generative Adversarial Networks (GAN). You will also explore non-traditional uses of neural networks as Style Transfer. Finally, you will look at Reinforcement Learning and its application to AI game playing, another popular direction of research and application of neural networks. What you will learn Optimize step-by-step functions on a large neural network using the Backpropagation Algorithm Fine-tune a neural network to improve the quality of results Use deep learning for image and audio processing Use Recursive Neural Tensor Networks (RNTNs) to outperform standard word embedding in special cases Identify problems for which Recurrent Neural Network (RNN) solutions are suitable Explore the process required to implement Autoencoders Evolve a deep neural network using reinforcement learning About the Author Antonio Gulli is a software executive and business leader with a passion for establishing and managing global technological talent, innovation, and execution. He is an expert in search engines, online services, machine learning, information retrieval, analytics, and cloud computing. So far, he has been lucky enough to gain professional experience in four different countries in Europe and managed people in six different countries in Europe and America. Antonio served as CEO, GM, CTO, VP, director, and site lead in multiple fields spanning from publishing (Elsevier) to consumer internet (Ask.com and Tiscali) and high-tech R&D (Microsoft and Google). Sujit Pal is a technology research director at Elsevier Labs, working on building intelligent systems around research content and metadata. His primary interests are information retrieval, ontologies, natural language processing, machine learning, and distributed processing. He is currently working on image classification and similarity using deep learning models. Prior to this, he worked in the consumer healthcare industry, where he helped build ontology-backed semantic search, contextual advertising, and EMR data processing platforms. He writes about technology on his blog at Salmon Run. Table of Contents Neural Networks Foundations Keras Installation and API Deep Learning with ConvNets Generative Adversarial Networks and WaveNet Word Embeddings Recurrent Neural Network — RNN Additional Deep Learning Models AI Game Playing Conclusion
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值