Generating text via SimpleRNN
I was able to undersand the basic idea behind RNN after working through an example from the book by Antonio Gulli.
I was able to undersand the basic idea behind RNN after working through an example from the book by Antonio Gulli.
I was puzzled with the way LSTMs were used to do sentiment analysis. Finally the book by Antonio Gulli helped me understand the mechanics of the LSTM.
In this article, I will explain the way you can code a simple RNN that tracks a simple shift in the pattern, i.e a value from a normal distribution.
As compared to previous implementations where we had used OutputProjectionWrapper, this code does away with that component and does it more efficiently
| |
| |
| |
The output from testing validation data is
In this article, I will explain the way you can code a simple RNN that tracks a simple shift in the pattern
| |
| |
| |
The output from testing validation data is
In this article, I will explain the way you can code a simple RNN that tracks cumulative sums of a sequence
| |
| |
| |
The output from testing validation data is
I have been struggling to implement parity of sequence since many weeks. Finally after going through Geron’s book, I am now able to successfully implement an algo that learns the parity of a sequence. This does not use the classification tweak that many apply to solve the parity problem
| |
| |
| |
The output from testing validation data is
The word “Bond” can depend on the context that you come across. If it is a community news letter, the bond could be used in the context of “Walk to Bond”, “Run to Bond”, “Meet to Bond”. Here the word “Bond”, means bonding.
In the context of Financial news, “Bond” could in all probability mean a financial instrument.
If you have a word2vec model, “Bond” is collapsed in to one dimension and hence loses all the context.

The following are the learnings from the podcast:
Need to work on basics of NN and then move on Transfer learning

The following are the learnings from the podcast:

The following are the learnings from the podcast
The dominant sequence transduction models are based on complex recurrent or convolutional neural networks in an encoder-decoder configuration. The best performing models also connect the encoder and decoder through an attention mechanism. We propose a new simple network architecture, the Transformer, based solely on attention mechanisms, dispensing with recurrence and convolutions entirely. Experiments on two machine translation tasks show these models to be superior in quality while being more parallelizable and requiring significantly less time to train. Our model achieves 28.4 BLEU on the WMT 2014 English-to-German translation task, improving over the existing best results, including ensembles by over 2 BLEU. On the WMT 2014 English-to-French translation task, our model establishes a new single-model state-of-the-art BLEU score of 41.8 after training for 3.5 days on eight GPUs, a small fraction of the training costs of the best models from the literature. We show that the Transformer generalizes well to other tasks by applying it successfully to English constituency parsing both with large and limited training data.

Kyle Polich discusses NER in this podcast. My learnings are

Kyle interviews Zane and Leena about the Endangered Languages Project . My learnings are
In this project, we are trying to speed up the process of language documentation by building a model that produces phonetic transcriptions from audio samples of human languages. The ultimate goal of our project is to develop a model that could be applied to any human language with minimal changes. We will be using around 3-4 hours of partially labeled audio data in an endangered language called Ladin, which we are using as our main training/test data. As of now we have produced some decent results in vowel identifications and are currently working on phoneme segmentation and identification of larger consonant categories.

Kyle Polich discusses sequence to sequence models. The following are the points from the podcast
fixed-input-fixed-output
Kyle Polich discusses with Liang Huang about his work on Baidu on Simultaneous translation. The following are the points covered in the podcast:
skype do not do simultaneous translation. They wait for the speaker to finish and then the system does the translation. Skype does consecutive translation and not simultaneous translation
Kyle Polich discusses with Andreas Stolcke about a paper that compares human and machine transcription study. The following are the highlights of the paper

The following are the learnings from a Data Skeptic podcast interview with Kevin Patel:
brown corpus and found that a dimension of 19 was enough to efficiently represent the word vectors in brown corpusI found the podcast very interesting as I have just started to understand the basic ideas of word embeddings and how they are used in NLP

The first three chapters of the book are targeted towards those who want to get a basic understanding of index funds. The first chapter talks about the massive growth of indexing and hence index funds & ETFs. The second chapter walks the reader through the history of various fund structures that came before index funds and ETFs. The third chapter gives a laundry list of entities that have benefited from the rise of index funds.

Gradient Boosting Algorithm is one of the powerful algos out there for solving classification and regression problems.This book gives a gentle introduction to the various aspects of the algo with out overwhelming the reader with the detailed math of the algo. The fact that there are a many visuals in the book makes the learning very sticky. Well worth a read for any one who wants to understand the intuition behind the algo.

The following are some of the points mentioned in the book :
![]()
This book is a great quick read that highlights various aspects of Neural Network components. There are three parts to the book. The first part of the book takes the reader through the various components of a Neural Network. The second part of the book equips the reader to write a simple piece of python code from scratch(not using any off-the-shelf library) that sets up a neural network, trains the neural network and test the structure for a certain set of test samples. The third part of the book adds some fun exercises that test a specific neural network.
![]()
The author says that there are five things about Neural Networks that any ML enthusiast should know:
Neural Networks are specific : They are always built to solve a specific problem
Neural Networks have three basic parts, i.e. Input Layer, Hidden Layer and Output Layer
Neural Networks are built in two ways
Feed Forward : In this type of network, signals travel only one way, from input to output. These types of networks are straightforward and used extensively in pattern recognition

The entire book is organized as 20 small bite sized chapters. Each chapter focuses on one specific thing and explains everything via visuals(as is obvious from the title).
The author starts off by explaining the basic idea of Random Forests, i.e. a collection of decision trees that have been generated via randomization. The randomness comes from the fact that a random subset is used from training the dataset and a random set of attributes are used for splitting the data. Before understanding the
![]()
This book provides a non-mathy entry point in to the world of decision trees and random forests.
Chapter 1 introduces the three kinds of learning algorithms:
Supervised Learning Algorithm: The algo feeds on labeled data and then use the fitted algorithm on unlabeled data
Unsupervised Learning Algorithm: The algo feeds on unlabeled data to figure out structure and patterns on its own
Semi-Supervised Learning: The algo feeds on labeled and unlabeled data. The algo needs to figure out the structure and patterns of the data. However it gets some help from the labeled data.
![]()
I stumbled on this book on my way to Yangon and devoured the book with in a few hours. It took me more time to write the summary than to read the book. The book is 300 pages long and full credit goes to the author for making the book so interesting.In this post, I will attempt to summarize the contents of the book.
This book is a fascinating adventure into all the aspects of the brain that are messy and chaotic. These aspects ultimately result in an illogical display of human tendencies - in the way we think, the way we feel and the way we act. The preface of the book is quite interesting too. The author profoundly apologizes to the reader on a possible scenario, i.e. one in which the reader spends a few hours on the book and realizes that it as a waste of time. Also, the author is pretty certain that some of the claims made in the book would become obsolete very quickly, given the rapid developments happening in the field of brain sciences. The main purpose of the book is to show that the human brain is fallible and imperfect despite the innumerable accomplishments that it has bestowed upon us. The book talks about some of the every day common experiences we have and ties it back to the structure of our brain and the way it functions.
![]()
Most of the decisions that we take or activities that we do, on a daily basis are not a result of deliberate thought. These are the result of habits that we have built over time. We realize some of these decisions/activities as habits but often carry out many activities in auto-pilot mode. This is good as it frees our mind to do other things. The flip side is that we do not seem to be in control of the actions and hence feel powerless.
The paper titled, “Making Covariance-Bassd Portfolio Risk Models Sensitive to the Rate at which Markets Reflect New Information”, makes a case against using any GARCH type of volatility estimate for portfolio risk estimation. Instead it suggests a simple way to incorporate changes in the level of implied volatility of the options in to the computation of risk of a portfolio comprising underlying securities.
The following is a brief summary of the paper :
![]()
Neo4j’s founder Emil Eifrem shares a bit of history about the way Neo4j was started. Way back in 1999, his team realized that the database that was being internally used had a lot of connections between discrete data elements. Like many successful companies which grow out of a founder’s frustration with status quo, Neo4j began its life from the founding team’s frustration with the fundamental problem with the design of relational databases. The team started experimenting on various data models centered around graphs. Much to their dismay, they found no readily available graph database to store their connected data. Thus began the team’s journey in to building a graph database from scratch. Project Neo was born. What’s behind the name Neo4j ? The 4 in Neo4j does not stand for version number. All the versions numbers are appended after the word Neo4j. I found one folksy explanation on stackoverflow that goes like this,
![]()
Cypher is a query language for Neo4j graph database. The basic model in Neo4j can be described as
Each node can have a number of relationships with other nodes
Each relationship goes from one node either to another node or to the same node
Both nodes and relationships can have properties, and each property has a name and a value
Cypher was first introduced in Nov 2013 and since then the popularity of graph databases as a category has taken off. The following visual shows the pivotal moment:

Git and Github have revolutionized the way one creates, maintains and shares software code. It is said to be the Linus Torvald's second gift to the world, first obviously being the Linux operating system. Nowadays it is common for job seekers to showcase their work in the form of several github repositories so that various employers can evaluate the job seeker in a much better way. Open source projects are thriving because of easy to use git based social coding platforms. The popularity of these platforms has grown to such an extent that many non-programmers are using git and github for maintaining version control of their work. Personally I know two nonfiction writers/journalists who use git to maintain their various documents.
![]()
Books such as these, give visual images that are necessary to make learning stick. It is fair to say that I do not remember anything much about cell biology nor anything related to DNA. It was way back in my high school that I had crammed something, held it in my working memory for a few years in order to write exams. Some bits would have percolated to my long term memory, but since I have never retrieved them, they lie somewhere in some inaccessible part of my brain.
A quote often attributed to Gloria Steinem says: “We’ve begun to raise daughters more like sons… but few have the courage to raise our sons more like our daughters.” Maker culture, with its goal to get everyone access to the traditionally male domain of making, has focused on the first. But its success means that it further devalues the traditionally female domain of caregiving, by continuing to enforce the idea that only making things is valuable. Rather, I want to see us recognize the work of the educators, those that analyze and characterize and critique, everyone who fixes things, all the other people who do valuable work with and for others—above all, the caregivers—whose work isn’t about something you can put in a box and sell.
![]()
Ani Pema Chodron, the author of the book, gave a commencement address to the 2014 graduating class of Naropa, University of Boulder, Colorado. She did so, to keep her promise with her grand daughter, who was amongst the graduating class. The speech went viral on the net and this book is an offshoot of it. It contains the full text of the speech and a Q&A session. The title of the speech and hence the book, is inspired from a quote by Samuel Beckett.
![]()
This book gives a a macro picture of machine learning. In this post, I will briefly summarize the main points of the book. One can think of this post as a meta summary as the book itself is a summary of all the main areas of machine learning.
Prologue
Machine learning is all around us, embedded in technologies and devices that we use in our daily lives. They are so integrated with our lives that we often do not even pause to appreciate its power. Well, whether we appreciate or not, there are companies harnessing the power of ML and profiting from it. So, the question arises, whether we need to care about ML at all ? When a technology becomes so pervasive, you need to understand a bit. You can’t control what you don’t understand. Hence at least from that perspective, having a general overview of the technologies involved, matters.
![]()
I stumbled on to this book a few weeks ago and immediately picked it up after a quick browse through the sections of the book. I had promptly placed it in my books-to-read list. I love anything related to information theory mainly because of its inter-disciplinary applications. The principles of information theory are applicable in a wide range of fields. In fact it will hard to pinpoint a specific area where concepts from information theory have not been applied. In this post, I will summarize the main points of the book.
Once quiet, we will hear an inner voice proclaim, “You are not enough.”
So why not just avoid the compost? Why not skirt the stinking heap?
For centuries poets and philosophers, theologians and therapists have taught us that turning over these compost piles is a risk we must undertake, for within these same mounds lies the fertile matter out of which new life arises and is nourished, a cyclic alchemy always at play, just as it is in any garden. This is the necessary work, the means of discovering spirit and self, a call that must be heeded. We do this by going deep. That is our charge.
![]()
There is no denying about the importance of Silence and Solitude in one’s life. For me, they have always provided an appropriate environment to learn and understand a few things deeply. Drawing from that experience, I strongly feel one should actively seek some amount of “silent time” in one’s life. Is it difficult for a person leading a married life, to carve out spaces of silence? Not necessarily. I remember reading a book by Anne D.LeClaire, in which the author writes about her experience of remaining completely silent on the first and third Mondays of every month. Anne explains that this simple practice brought tremendous amount of calmness in her family life. The family members unknowingly start giving importance to “pauses”, the “pauses” that actually make the sentence meaningful, the “pauses” that make the music enjoyable, the “pauses” that make our lives meaningful. Indeed many have written about the transformative experience of silence. But how many of us consciously seek silence and more importantly incorporate in our daily lives ? In the hubbub of our lives and in our over-enthusiasm for acquiring/reaching/grabbing something that is primarily externally gratifying, we often turn our back on “silence” and consequently deny or at least partly deny those experiences that are internally gratifying.
![]()
The book titled, “The Golden ticket”, gives a non-technical introduction to the most important unsolved problem in the computer science,“Whether P = NP?”. If you are curious about knowing this problem and do not want to slog through the dense math behind it, then this book might be a perfect introduction to the problem. The author makes sure that the concepts are introduced using plain English and nothing more. By the time you are done with the book, I bet you will start appreciating a few if not all the NP-complete problems that are yet to be cracked. In this post, I will try to summarize briefly the main points of the book.
Via Sarada:
Professor Babai of the University of Chicago recently made an alleged breakthrough in theoretical computer science which concerns the problem of graph isomorphism. In lecture, we have often been told that there are massive networks in biology and social media, to only name two areas, that can not be effectively visualized because of the sheer mass of links and nodes; these networks can grow to be so convoluted that computers occasionally have a difficult time telling if two networks are, in fact, identical or not in an acceptably short time. This is an issue of computational complexity.
Via Wired :
A pure mathematician, when stuck on the problem under study, often decides to narrow the problem further and so avoid the obstruction. An applied mathematician interprets being stuck as an indication that it is time to learn more mathematics and find better tools.
Via [NYT](When a Unicorn Start-Up Stumbles, Its Employees Get Hurt):
This article shows the painful reality of employees who worked at a $1B valued start-up, that went south.
Instead of they getting paid to work, the employees ended up paying to work for the start-up.
If I were a medical man, I should prescribe a holiday to any patient who considered his work important.
- Bertrand Russell
“You say I am repeating
Something I have said before. I shall say it again.
Shall I say it again? In order to arrive there,
To arrive where you are, to get from where you are not,
You must go by a way wherein there is no ecstasy.
In order to arrive at what you do not know
You must go by a way which is the way of ignorance.
In order to possess what you do not possess
You must go by the way of dispossession.
In order to arrive at what you are not
You must go through the way in which you are not.
And what you do not know is the only thing you know
And what you own is what you do not own
And where you are is where you are not.”
- T.S.Eliot
Thoroughly enjoyed this no BS talk by Manoj Bhargava.
The paper titled, “Statistical Modeling – The two cultures ”, by Leo Breiman(man behind CART) was published 14 years ago, a time when machine learning techniques had started to become popular. In the last decade or so, the field has exploded. There are many graduate and PhD programs that are offering full-fledged courses on the subject. There are also dedicated journals that publish ML research findings of researchers from a wide range of fields. Larry Wasserman attributes the quick rise of the field to “conference culture ”, an environment where an ML researcher is valued based on his/her conference publications. The thought process and the activities that precede a “conference publication” is different from the usual “journal” publication and this enables an ML researcher to work on far many interesting problems usually from a diverse set of areas as compared to a statistician.
![]()
If one rips apart a computer and looks at its innards, one sees a coalescence of beautiful ideas. The modern computer is built based on electronics but the ideas behind its design has nothing to do with electronics. A basic design can be built from valves/water pipes etc. The principles are the essence of what makes computers compute.
This book introduces some of the main ideas of computer science such as Boolean logic, finite-state machines, programming languages, compilers and interpreters, Turing universality, information theory, algorithms and algorithmic complexity, heuristics, uncomutable functions, parallel computing, quantum computing, neural networks, machine learning, and self-organizing systems.
![]()
The author tries to answer two questions via this book :
What are the core elements of a fulfilling work ?
How should we make a change to our current path so that our work is in line with our being.
Give meaning to work
The author talks about five aspects relevant to work :
earning money
achieving status
making a difference
following our passions
using our talents
The author categorically states the earning money and achieving status might not give meaning to our work. Most often than not, one gets on to a “hedonistic” treadmill that is difficult to get off. Instead pursuing “making a difference” path is a better option. It might lead an individual to try out a variety of jobs, learn a variety of skills, and become a portfolio worker. It is one of the ways to explore “many selves” that lie within us. The chapter also explores the various challenges that one might have to face in following any of the above paths. Personally I find “using your talents” path to be quite appealing. I have taken a path of “developing talents and then doing your bit in making your talents useful to others”. If you forget the monetary aspect and status aspect of any work and immerse yourself in developing talents, I guess one might find that learning a specific skill and putting it to use, could be a wonderful experience. There are obvious challenges that one must encounter on day to day basis. However I guess the “love” element towards your work will give all the strength to face the challenges. The author’s message from this chapter is that there are three core elements of a fulfilling work, i.e. meaning, flow and freedom. Each of these elements are concisely discussed via examples and anecdotes. Light reading but there is no fluff here.
In this post, I will attempt to briefly summarize the main points of the book
The chapter starts off by saying that there are indeed people in the world who become extremely popular, make tons of money, get all the press coverage, by providing a perfect explanation, after the fact. The author gives one such example of a public figure who rose to fame explaining events post-fact, Tom Friedman. At the same time, there are many people who are lesser known in the public space but have an extraordinary skill at forecasting. The purpose of the book is to explain how these ordinary people come up with reliable forecasts and beat the experts hands down.
“Do not be too timid and squeamish about your actions. All life is an experiment. The more experiments you make the better. What if they are a little coarse and you may get your coat soiled or torn? What if you do fail, and get fairly rolled in the dirt once or twice? Up again, you shall never be so afraid of a tumble.”
-- Ralph Waldo Emerson
![]()
The book starts by explaining an example project that one can download from the author’s github account. The project files serve as an introduction to reproducible research. I guess it might make sense to download this project, try to follow the instructions and create the relevant files. By compiling the example project, one gets a sense of what one can accomplished by reading through the book.
**Introducing Reproducible Research
**The highlight of an RR document is that data, analysis and results are all in one document. There is no separation between announcing the results and doing number crunching. The author gives a list of benefits that accrue to any researcher generating RR documents. They are