Tuesday, December 6, 2016

Get Keras ready with Theano backend

Keras is a deep learning library for Theano and TensorFlow which is written in Python. It allows you to build deep learning models with a few code lines. And also it enables fast experimentation. It is compatible with Python 2.7-3.5.

The name Keras was based on a Greek mythology. Keras means 'Horn' in Greek. They believed that the dream spirits who come through the polished horn, have truth behind them. Keras was initially build as a part of the research project, ONEIROS (Open-ended Neuro-Electronic Intelligent Robot Operating System)

Keras library has following characteristics

  • Easy and fast prototyping
  • Supports both convolutional networks and recurrent networks.
  • Supports arbitrary connectivity schemes
  • Run flawlessly on CPU and GPU

There are four guiding principles for Keras

  1. Modularity- A model is understood as a sequence or a graph of standalone, fully-configurable modules that can be plugged together with as little restrictions as possible. In particular, neural layers, cost functions, optimizers, initialization schemes, activation functions, regularization schemes are all standalone modules that you can combine to create new models.
  2. Minimalism-Each module should be kept short and simple. Every piece of code should be transparent upon first reading. No black magic: it hurts iteration speed and ability to innovate.
  3. Easy extensibility- New modules are dead simple to add (as new classes and functions), and existing modules provide ample examples. To be able to easily create new modules allows for total expressiveness, making Keras suitable for advanced research.
  4. Work with Pyhton-No separate models configuration files in a declarative format. Models are described in Python code, which is compact, easier to debug, and allows for ease of extensibility.

Theano


Theano is a mathematical symbolic expression compiler. It's tightly integrated with Python ecosystem. It can use GPUs and perform efficient symbolic differentiation. This was designed to handle the complex computations of Deep learning. It handles multidimensional arrays like Numpy. There are many opensource deep learning libraries built on top of Theano, like Keras. Google created Tensorflow to replace Theano. However there is no huge difference  between Theano and TensorFlow. 

To install Theano and Keras, refer the Keras documentation here. If you are using Windows 10, refer this article here.

Note: There is no point of installing CUDA , if you don't have NVidia graphical processing unit. Then  Theano will run on CPU instead of GPU. If you have NVidia card, I highly recommend you to install CUDA, the performance will be high when Theano runs on GPU.  
  




No comments:

Post a Comment