ஆழக்கற்றல் – Deep Learning – மின் புத்தகம்

Michael Nielsen, a well known computer scientist and Quantum Computing expert [author of famous: ‘Introduction to Quantum Computation and Quantum Information,’ with Isaac Chuang, has written a nice book in expository detail about Deep Learning.

Front Cover
Book: “Quantum Computation and Quantum Information” from authors Michael Nielsen, Isaac Chuang. (C) 2000 Cambridge University Press. Google Books URL here

Nielsen’s new book, Neural networks and deep learning here, has taken a more modern approach to (web) publishing in releasing the whole book in Creative Commons Non-Commercial Share Alike [NC-SA] license.

இந்த புத்தகத்தில் கணினி தரவுகளைக்கொண்டு எப்படி [ஒரு படிபடியான் நிரல் இல்லமல், தரவின் கற்றல் வழியே மற்றும்] நிரைய செயல்பாடுகளை சாதிக்கமுடியும் என்றும், இதன் அடிப்படையான செயற்கை நரம்புகளின் பினைப்புகள் மற்றும் அதன் கோட்பாடுகளையும் உடைத்து வைக்கிரார் திரு. நீல்சன். அல்வா மாதிரி ருசித்து பருகுங்கள்.

செயற்கை நரம்புகளின் பினைப்புகள் [‘Artificial Neural Networks’] மூலம் எப்படி கையெழுத்து வழி எண்களை உணரலாம் ? வழிகள் கூறுகிறார் திரு. நீல்சன் Neural networks and deep learning என்ற புத்தகத்தில்

பொறியாளர்கள் கவணம்! இதனை தமிழாக்கம் செய்யலாம் – முனைவீர்களா?


வருங்காலத்தில் ஒரு தமிழ் செயற்கை நுண்ணறிவு உருவாக்கப்படும். உடனுக்குடன் ‘இன்ஸ்டண்டா’ ஆங்கிலத்தில் இனையான தமிழ் சொற்களை தேடி அல்லது உருவாக்கி சொல்லும். ஆமாம் எந்திரம் சொல்லாடலில் எப்படியும் உள்ளே வரப்போகிரது. நமக்கும் உதவட்டுமே!

தமிழ் மரபுகளுடன், மொழி பழக்கவழக்கங்களுடன் சரிவர, முடிந்த அளவு வட மொழி சொற்கள் சேற்காமல், மேலும் ஒரு படி அதிகமாக ஆங்கிலம் கலப்பின்றி [முற்றிலும் ஒழிக்கமுடியுமா? தெரியவில்லை; கணினிதானே, இலக்கைவைத்தால் முடியாதா என்ன ?]

R2-D2 மற்றும் C-3PO Star Wars திரைபடத்தின் கதாப்பாதிர ரோபோக்கள்.

R2-D2 மற்றும் C-3PO Star Wars திரைபடத்தின் கதாப்பாதிர ரோபோக்கள். (c) Lucas Films, Inc. and Star Wars franchise

இத்தகைய செயற்கை நுண்ணறிவு உருவாக்கினால், அதற்கு செல்வா என்று செல்லமாக பெயரிடுவோம். அரிமா ரோபோ C-3PO, R2D2 மாதிரியான, புவியில் இல்லாத தமிழ் அறிவு கொண்ட ஒரு ஓரகில் [Oracle]-ஆக அமையுமோ என்னவோ. ஐயா கலாம் சொன்னது கனவுகள் நினைவாக விழித்திடு; தூக்கத்தை கலைத்திடு.


India A.I. task force report

Indian government Ministry of Commerce has released a report on the developing A.I. related tooling, technologies, marketplaces and workforce – read more here

The AI Taskforce also has a website aitf.org.in

At this time I do not have an analysis on this report itself; but it does seem like India is trying to (in principle) catch up with other nation states.

GPUs powering the AI revolution

Ganapathy Raman Kasi*, Muthiah Annamalai+

[This article originally appeared in the 2017 Tamil Internet conference, UT-SC, Toronto, Canada, magazine ]


The current hot trend in AI revolution is “deep learning” – which is a fancy way of talking about multi-layered convolutional neural networks; this field of study has heralded a new age in computing extending human capabilities by automation and intelligent machines [1].

These neural networks aren’t the same as neuron networks in your brain! We are talking about artificial neural networks which reside in computers and tries to mimic the biological neural network with its synapses (connections) of axons, dendrons and their activation potentials. These thinking machines have their beginnings in post WW-II research at MIT, in the work of Seymour Papert who introduced “Perceptrons,” and Norbert Weiner’s “Cybernetics”.

But do we know why there is sudden interest in these biologically inspired computer models ? It is due to GPUs which has accelerated all the complex computations associated with neural networks for it be practical in such a large scale. They allow these networks to operate on gigabytes (or even terabytes) of data and have significantly reduced the computation time from months to days, or days to hours, or hours to minutes usually by an order of magnitude – not possible in an earlier generation of computing. Before we jump into the details let us understand why we need deep learning and convolutional neural networks in the first place.

Scientific Innovations

Science and engineering have traditionally advanced by our ability to understand phenomena in natural world and describe them mathematically, since the times of Leonardo Da Vinci, Nicolas Copernicus, Galileo Galilei, Tycho Brahe, Johannes Kepler and Isaac Newton. However gaining models through experimentation and scientific breakthroughs piece-meal for each problem at hand is a slow process. Outside of Physics and Mathematics the scientific method is largely driven by an empirical approach.

It is in such pursuits of building models of unknown processes where observational data far exceed our human intelligence to divine an analytical model, the advent of deep learning and GPU based multi-layered neural networks provide an ad-hoc computable model. System identification for particular classification tasks, image recognition, and speech recognition to the modern miracle of a self-driving cars are all enabled by deep learning technology. All this came about due to the seminal work of many innovators culminating in the discovery of efficient convolutional neural networks by Prof. Geoff Hinton, who trained them by hardware acceleration via GPUs.

An original pioneer in the field of AI, before the AI winter, Prof. Geoff Hinton and co-workers [2] recently showed deep learning models that beat status-quo benchmarks on classification and prediction tasks on the following speech, text or image datasets: Reuters, TIMIT, MNIST, CIFAR and ImageNet, setting off the renewed interest in the field of AI from academia and industry giants – Google, Microsoft, Baidu and Facebook alike [3].

What is a GPU ?

GPU stands for Graphics Processing Unit [4]. These were originally designed for graphics rendering used in video games in 1990s. They have a large number of parallel cores which are very efficient for doing simple mathematical computations like matrix multiplications. These computations are the fundamental basis for machine learning methods such as deep learning. While the improvement in CPUs over years has slowed down over the years as Moore’s law has hit a bottleneck, the GPUs increase in performance has continued unabated showing tremendous improvements over the generations.

Figure. 1 (left): Deep Learning training task times as function of various GPU processors from NVidia. Figure. 2(right): AlexNet training throughput for 20 iterations on various CPU/GPU processing platforms.

Such GPUs were originally invented for shading algorithms algorithms, are now applied in training large machine learning models using a Open CL or CUDA like frameworks (variants of C-language with description for parallel execution via threading) from the vendors.

The pioneering hardware vendors include Nvidia with their GPU series like GeForce, Tesla; AMD with its Radeon, GP GPU, Google has entered this race with its TPU (Tensor Processing Unit) and some offerings from Intel for ML training applications. Nvidia and AMD are the main players in the GPU space with Nvidia laying special emphasis on parallel computing and deep learning over the years. Nvidia just announced the new Volta generation chip based GPU V100 which is about 2.5 x faster than the previous generation chip Pascal GP100 which was announced less than 2 years ago [5].Compared to CPU, however GPUs are more than 50x faster for Deep learning. Performance of GPUs as function of various GPU families in shown in Figure. 1, and for another AlexNet data set is shown in Figure. 2.

Hardware Innovation

If the Harvard architecture and RISC architecture based CPUs have been workhorses of personal computer revolution, then the advent of high framerate video-gaming pushed the CPU based graphics rendering from CPU + Video card based rendering to CPU + GPU, to CPU + GPU + GP-GPU (general purpose GPU); some of this overview is shown in Figure. 3a, 3b.

Figure. 3(a,b): Evolution of GPU performance from video graphics cards and rendering from CPU; courtesy PC Magazine [4]; Figure. 3(c): NVIDIA Tesla GPU applications in scientific research.


GPU’s are suitable for large numerical algorithms where various data have to be moved through a computational pipeline often in parallel; this SIMD problem, like genome sequencing shown in Figure. 3c, when solved by GPU gain the maximum speedup/acceleration. However, there is a fundamental limitations of GPU acceleration due to the Amdahl’s law which saturates the parallelization upto the available serial bottlenecks for a given computational task.

Software Frameworks

To build a deep learning application one may use their labeled datasets to build a learning model on any of the various frameworks [6] (both open-source or closed) provided from competing vendors in the industry as follows:

  1. TensorFlow, developed by google, python API over C++ engine, low level api, good for researchers, not commercially supported; notably Google is in process of developing a TPU – an advanced version of GPU for direct use with TensorFlow.

  2. Caffe 2, developed by UC Berkeley used at Facebook among other places, focussed on computer vision, one of the earlier frameworks to gain significant adoption, Python API over C++ and CUDA code

  3. Scikit Learn (Python based) general inference and machine-learning framework

  4. Theano written in python, grand-daddy of deep learning frameworks

  5. CNTK developed by Microsoft


Tamil applications for deep learning including providing or improving existing solutions to the problems of,

  1. Tamil Speech Recognition
  2. Tamil Character Recognition [7,8]
  3. Natural Language Processing for Tamil

Hardware acceleration and availability of big-data (labeled datasets) will play key role in the success of applying deep learning techniques to these problems.


  1. Jensen Huang, “Accelerating AI with GPUs: A New Computing Model,” link

  2. G. E. Hinton et-al. “Imagenet classification with deep convolutional neural networks,” Advances in Neural Information Processing Systems (2012).

  3. LeCun, Y., Bengio, Y. and Hinton, G. E., “Deep Learning” Nature, Vol. 521, pp 436-444. (2015), link.

  4. GPU definition at PC Magazine Encyclopedia, PC Magazine, (2017) link.

  5. Tesla GPU Application notes from NVidia, (2017) link.

  6. Comparing deep learning frameworks”, Deeplearning4j.org (2017), link.

  7. Prashanth Vijayaraghavan, Mishra Sra, “Handwritten Tamil Recognition using a Convolutional Neural Network,” NEML Poster (2015) link.

  8. R. Jagadeesh Kannan, S. Subramanian, “An Adaptive Approach of Tamil Character Recognition Using Deep Learning with Big Data-A Survey”, Proceedings of 49th Annual Convention of Computer Society of India (vol. 1) pp 557-567 (2015), link.

Classifying Tamil words – part 1


One of problems faced when building a Tamil spell checker, albeit somewhat marginal, can be phrased as follows:

Given a series of Tamil alphabets, how do you decide if the letters are true Tamil word (even out of dictionary) or if it is a transliterated English word ?

e.g. Between the words, ‘உகந்த’ vs ‘கம்புயுடர்’ can you decide which is true Tamil word and which is transliterated ?


This is somewhat simple with help of a neural network; given sufficient “features” and “training data” we can train some of these neural networks easily. With current interest in this area, tools are available to make this task quite easy – any of Pandas, Keras, PyTorch and Tensorflow may suffice.

Generally, the only thing you need to know about Artificial Intelligence (AI) is that machines can be trained to do tasks based on two distinctive learning processes:

  1. Regression,
  2. Classification

Read more at the Wikipedia – the current “problem” is a classification task.


Naturally for task of classifying a word, we may take features as following:

  1. Word length
  2. Are all characters unique ?
  3. Number of repeated characters ?
  4. Vowels count, Consonant count
    1. In Tamil this information is stored as (Kuril, Nedil, Ayudham) and (Vallinam, Mellinam and Idayinam)
  5. Is word palindrome ?
  6. We can add bigram data as features as next step

Basically this task can be achieved with new code checked into Open-Tamil 0.7 (dev version) called ‘tamil.utf8.classify_letter

Screen Shot 2017-12-17 at 1.03.03 PM.png

Data sets

To make data sets we can use Tamil VU dictionary as a list of valid Tamil words (label 1); next we can use a transliterated list of words from English into Tamil as list of invalid Tamil words (label 0).

Using a 1, 0 labeled data, we may use part of this combined data for training the neural network with gradient descent algorithm or any other method for building a supervised learning model.

Building Transliterated Data

Using the Python code below and the data file from open-tamil repository you can build the code and run it,

def jaffna_transliterate(eng_string):
  tamil_tx = algorithm.Iterative.transliterate(jaffna.Transliteration.table,eng_string)
  return tamil_tx

def azhagi_transliterate(eng_string):
  tamil_tx = algorithm.Iterative.transliterate(azhagi.Transliteration.table,eng_string)
  return tamil_tx

def combinational_transliterate(eng_string):
  tamil_tx = algorithm.Iterative.transliterate(combinational.Transliteration.table,eng_string)
  return tamil_tx

# 3 forms of Tamil transliteration for English word
jfile = codecs.open('english_dictionary_words.jaffna','w','utf-8')
cfile = codecs.open('english_dictionary_words.combinational','w','utf-8')
afile = codecs.open('english_dictionary_words.azhagi','w','utf-8')
with codecs.open('english_dictionary_words.txt','r') as engf:
for idx,w in enumerate(engf.readlines()):
  w = w.strip()
  if len(w) < 1:

to get the following data files (left pane shows ‘Jaffna’ transliteration standard, while the right pane shows the source English word list); full gist on GitHub at this link

Screen Shot 2017-12-17 at 1.47.42 PM.png

In the next blog post I will share the details of training the neural network and building this classifier. Stay tuned!