Thursday, January 14, 2016

Prerequisites for Conditional Random Fields

When I first started out to learn CRFs there was a scarcity of material that I could consume. They were either too technical for my ability or were repeating what I already knew. This article hopes to bridge that gap and allow you to read material on CRFs. We assume knowledge of some math related to set theory and probability theory.

  1. Factorization of functions is when a function is shown to be the product of some other functions. 
  2. Probability
    1. It is the chance of something happening.
  3. Graphs
    1. A Graph is defined as a set of Vertices, Edges. The edges may be directed or undirected.
    2. A Bipartile graph is a one in which the vertices can be split into two groups where members of a group are note connected to any other member of that group.
    3. A factor graph is a Bipartile Graph representing the factorization of a function.
  4. Graphical Model
    1. Probabilistic Graphical Models are probabilistic models where a graph represents the conditional dependence structure between variables.
    2. Two branches of graphical representations of distributions are common.
      1. Bayesian networks
        1. Hidden Markov Models (HMMs) and Neural networks are special cases of Bayesian networks
      2. Markov networks/ Markov random fields
    3.  Markov networks may be cyclic and are undirected whereas Bayesian networks are directed and acyclic.
  5. Markov property
    1. At it's core the Markov property asserts memory-less-ness.
    2. It says that each observation must not be influenced by the past ones.
  6. Just as Capital sigma is used to denote the sum of a series, product of a series is denoted py PI.
Feel free to delve deeper into that body of knowledge before understanding what a CRF is. Understand what they represent before stepping onto this next lot.

A Conditional Random field is an undirected probabilistic graphical model. It is used to predict a set of classification labels for a set of inputs. Instead of considering a single input variable individually it considers the effect of neighbours.

A well worn example is the English sentence. Classifying the words of a sentence as 'verb', 'noun' etc while individually looking at the word is classification. A CRF would look at the neighbouring words too and thus predict the classification for the entire sentence together and not just one word at a time.

A CRF is a graphical model where the set of vertices can be split into two disjoint sets X and Y such that X is the set of inputs and Y is the set of outputs and then the conditional probabilities are modeled according to P(Y|X).

A very good example of CRF with python can be seen in this notebook (Jupyter Notebook).

Monday, January 11, 2016

Defying Destiny And Why It's So Lucrative

Destiny is a veiled trickster, raising some to the pedestals of glory while playing cruel tricks on others. Destiny has always held human fascination. It might be because destiny itself is conceived as an immortal thing. It implies that we are instruments of something else. Something greater. It beguiles us into thinking that we matter.

Yet when it comes to defying it, we do so with great passion. Defying one's destiny is the strongest way in which we can express our free will. We can say to the maker, "I shall not accept what you have given me."

A man who works from a disadvantaged position and still wins. Such a man is indisputably the champion. Such a man is defying his destiny that wants to crush him. This is seen across all walks of life. The student who is not a genius, the sumo who is small, the underdog. That is what attracts us to those feats of

We admire people who do this and yet shun them when we are in groups. We do that because we are afraid. This man has shown that nothing can keep a man who has made his mind. Then who was it who kept us from doing what we want?

I have been reading up on sumo for a while now. A distinction between sumo and other similar contact sports is that in professional sumo, there are no weight categories. There are no costumes.

A man competes with spirit, body and technique, completely discarding all other things which do not matter. It is an art of balance where if any other body part touches the ground other than the feet, you lose. If you exit the ring you lose.

One can see why Japan has the national sport of Sumo. The national sport of a nation declares the type of competition people there like. Sumo is a very simple sport and yet introduces complexities of immense magnitude in the higher levels. It is only because it is so simple to lose in sumo that it is so difficult.

I highly recommend Sumo to anyone looking to find inspiration in their lives.

Saturday, January 9, 2016

Infinity Stone

Imagine the existence of a person on a sphere. The person can never find the end of the sphere and will yet run out of new places to see.

It is easy to reverse the question and look for things which have boundaries but an infinite number of states.

It might be interesting to see such a path of thinking explored. Does this model fit an infinite automaton?