Randomize.Research

A series of fortuitous events

Summer 2013

Hi All,

Its been a while since I wrote any post. In this post I will share my summer so called adventures, my time at XRCE and my stay in Grenoble.

Xerox working place : Mamma Mia! The campus is situated in the midst of residential area. So quite, calm and peaceful. You can here the sound of the wind grazing the tree leaves. This is unlike any campuses in India where you can hear the noise from people blowing horn every second.

Xerox copyright Issues : I was quite apprehensive about the “research” done in Xerox, thought why would a company share their research with the world free of cost! Well, not I know its not the case. You have to file a patent before you start sharing anything to the outside world. I kind of have this knack of sharing everything that I do, so it was a little difficult to adjust to the new terms and conditions.

Things to do in Grenoble : Summer time you have the opportunity to go out for hiking, climbing (given that one is not afraid of heights). There are concerts every week in the big parks of Grenoble. Once a month the local municipality finds a reason to celebrate this or that with fireworks on a large scale. All the people in Grenoble gather in one place to watch it, its exciting!

French Food : Grenoble’s french cuisine is one thing that didn’t suit me. Well one could argue that its the best but I just didn’t like it. I checked quite a few restaurants here, some Indian restaurants too and  yes they serve quite close authentic Indian food. I regularly visited an Indian store here, which is open from 10AM to 12 midnight. I don’t find this in Trento 😦

Places I got to see : I traveled a lot during my stay here. First trip was a one day trip to beautiful Annecy with Xerox colleagues. We packed the bags, left early morning, biked around 40 kms in Anncey and returned back the same day. It was a tiring but an amazing experience.  Second trip was a “long weekend” trip to Paris. We were 3 guys, thankfully one of us knew french and it helped to quite an extent. This was the time when I was introduced to authentic delicious and expensive French food. I liked it!. Third trip was a short “official” trip to Sofia, Bulgaria for a conference. I got to see a little of Sofia thanks to a walking tour, a little of nightlife thanks to some colleagues. Last trip was a week long trip to Turkey, this trip was one of the best holidays of my life. Beach, *amazing food*, sun, friends and a Turkish wedding .. still these words are not enough in describing this vacation.

Work : Apart from having a time of my life I worked quite a lot. We ended up in filing two patents!! (can’t talk about this more than that : refer to Xerox Copyright Issues )

Thats about it!

Thanks for dropping by this post!

Prashant

Advertisements

Incremental Training

Recently I was reading this awesome PhD thesis by Abby Levenberg on Stream based Machine Translation. In this kind of scenario an MT system is fed a stream of data from time to time instead of all data at once. Batch learning fails in this scene because we cannot train the data everytime a stream is fed to a system, its a painfully long process. Thus, it marks the dawn of incremental learning, the 2.0 version of batch learning.
The process which takes the most of the time in training MT models can be said to be aligning the words in the sentence. This is a generative process which uses EM algorithm to align these words. Well it is really difficult to explain EM algorithm with a short description. As the name suggests the algorithm consists of two basic steps of Expectation and Maximization. First, the algorithm assumes all alignments equally likely, giving us the alignment probabilities. Using this probability model we collect the counts(sufficient statistics) for each pair of sentence (Expectation step). Using these fractional counts we estimate the alignments probabilities by normalizing them (Maximization step).
A pseudo code of EM taken from Levenberg’s paper
EM Algorithm
A modern version of EM is stepWise EM which uses stochastic approximation at the expectation step to collect the counts. Further, instead of clearing the counts at each iteration it keeps a track of the old counts and linearly interpolate them with the current counts to estimate the new alignment probabilities.
A pseudo code of both these algorithms taken from Levenberg’s thesis
StepWise EM algorithm

PS :
1. The thesis also shows that incremental algorithm performs almost the same as batch.
2. Online learning, incremental learning are quite hot topics in NLP nowadays.

Online command implementation in Moses

I am currently integrating the functionality Online Command in Moses developed by a colleague of mine. This functionality allows one to change the weights of the models at the time of decoding. There is a similar kind of functionality implemented in WIPO branch of Moses. Anyways, I’ll get to the problem.

In this functionality each line is a sentence or a weight. If one wants to change a language model’s weight to 0.5, just insert a line

@CMD@ weight-l 0.5

before the sentence whose model’s weight you want to modify. In order to do that, I need Moses to read the file one line at a time and not all at once.

Coming to coding, if you look at Main.cpp in directory moses-cmd/src/

 

InputType* source = NULL;
size_t lineCount = 0;
while(ReadInput(*ioWrapper,staticData.GetInputType(),source)) {
IFVERBOSE(1) {
ResetUserTime();
}
// set up task of translating one sentence
VERBOSE(3, “Setting up task of translating one sentence\n”);
TranslationTask* task =
new TranslationTask(lineCount,source, outputCollector.get(),
nbestCollector.get(),
latticeSamplesCollector.get(),
wordGraphCollector.get(),
searchGraphCollector.get(),
detailedTranslationCollector.get(),
alignmentInfoCollector.get() );
// execute task
#ifdef WITH_THREADS
pool.Submit(task);
#else
task->Run();
#endif

 

In this code if one is not using thread  pool.Submit(task)  should not be called. However, it is being called and I still have no idea why? Due to this all the lines in the input file were read at once in the threads and they were decoded after the threads were flushed. So, the last modified weight was applied to all the sentences which was bad!

So, I tried to figure out how not to let the code go in pool.Submit() fucntion. When I comment out


//#ifdef WITH_THREADS
// pool.Submit(task);
//#else
task->Run();
//#endif

The code worked like a charm. Although, commenting out these lines means the code is not thread safe anymore.

PS: If you want to download this functionality try out https://github.com/fbk-hlt/mosesdecoder

Kashmir — stairway to heaven…

Last summers we went to kashmir with some unaccompanied minors…

A short review….of our journey…..
Jaipur —-> Jammu —–> Srinagar —–> Sonmarg  ——> Patnitop —–> Bak to pavilion…..

jOURNEY TO jAMMU….

First Day :

we were pretty much tired after a long tiring journey in the sleeper class…
well jammu is not different as we think..
jammu’s weather and jaipur’s there isn’t much of a difference… plus its not much above sea level ….

Way to Heaven’s Door!!!

Journey ran through the hilly areas…as we took the road we saw that all of it was inhabited by the jawans of the force…
either side was the doorway to heaven…( literal sense )….i mean either side there was danger…man!! drivers are so impeccable..they drove as they already knew the accurate measurement of the roads…
on the highway…  sides were covered by pine tress…I was mesmerized by the scenery…and the fog added to its exquisiteness…finally we reached our station…
ah!!! Srinagar…so much green … i was amazed to c this much of greenry….hey!! i belong to rajasthan.!! ( an obvious reason )…

next day we all had to wake up early so that v cn visit all the picturesque sites…

Actually its not in my hands to narrate the beauty that i saw there…or to say i m not the right one…

Frankly speakin all the gardens appeared same for me…
They were all design in same old fashioned way…the staircase types…but were looking fabulous…as they all counted on the marvelous creations …The TULIPS….

We visited these many places…in srinagar…
1. Chasmeshahi Garden:   Black Rose …. it is said that the person who sees a black rose is lucky…leave it!! even that black rose couldnt chng my luck!! …

2. Shalimar and Nishat Garden: built by some maharaja in some century…one of them had a “chinar tree”…it is good for health of a diabetic patient to sit under the tree…

3. Parimahal Garden:  i forgot about this place … but i cn tell u that it was equally good…

4. Dal Lake: water skiing…shikara…house boats…floating market…vr all fun…it reminds me of their culture…

5. Shankara Charya Temple: gives a panaromic view of the city…jhelum can be seen as a snake whirling around the city….

No destination was quite so romantic, no setting was as enchanting as Srinagar. More or less in the center of Kashmir, Srinagar’s allure changes with the passing of each season. Srinagar is as much imagination as it is fact, for every season offers new vistas to this city of great antiquity. Spring breathes life again into a frozen world, and the air is heady with the fragrance of a million flowers that blossom on trees, shrubs and creepers. Summer heightens the effect, and autumn is poignant in its colors of warm introspection. Winter brings with it snow, sometimes the Dal Lake freezes, and beneath a leaden sky, roasted chestnuts turn the atmosphere aromatic with the promise of warmth and comfort.

That was all of it in short ……… 🙂

U must visit kashmir atleast once in ur lifetime ……..

PS : v visited sonmarg too…but it will b too long if i mention it here..

A Dreadful Night ….A tragedy!!!

Yo Guys !!

Must have seen many love stories but this one is different coz its my love story!!!

There was a girl who entered my life without knocking d door…

She was in ma school…In our school, the system was so that every year our sections keep on changing…

I always thought that hopefully this time she’ll be my classmate.. I don’t know why but I liked her very much. She

was the kind of girl whom I dreamt of… The girl of my dreams.. ##Most of my time went by thinking of her.. How do I get a chance to talk to her…(was a big question that went thru my mind whenever I saw her)… But when I grew up I realized that it was rather infatuation than love… then I started concentrating on my studies. After my tenth class I left the school and went for the preparation of IIT JEE in kota.. Even after the two years of coaching in bansal classes (one of the prestigious institute for the coaching of IIT JEE) I was not able to crack the exam … but I got admission in IIIT Hyderabad.. A good institute… (I thought so at that time)… but after cumin in this college I realized what have I done… the first year went by doing assignments and in studies…(he he jus joking… ) all the time went by doing nothing… meanwhile orkut came… then I started recollecting my lost friends I came across many of my old school friends and again I became in touch with them… then I began to collect my past memories of the school where I have spent most amazing part of my life…and whenever I thought about her I became nostalgic… I remembered her face till now (woooh!!) What!! no one can ever remember a face so fine, I could even draw her face… then I thought on this situation deeply how could this happen!! It was only an infatuation that I went thru, then how is this possible?? … I finally came to THE Conclusion that the girl had made a place somewhere in my heart… I again came in contact with her thru orkut thingy… U guys must b thinking that I searched for her but no!! Wait, she first joined my community anselm’s alumni… and then to she scrapped me first!!! (hooorraaah!!!) then we talked about each other professionally…

What r u doing nowadays??

Where were u ??

How r ur studies??

N all that blah blah blah!!

Oh!! sry forgot to tell u something that there was fren of mine who was in a very close relationship with her (Relationship==Brother) and I came to know all her whereabouts thru him…

she was studying in Lakshamgarh I already knew but still I asked her where is she nowadays … just a formality 🙂

When my summer holidays came ( a 3 months break!!!) … I thought that I would at least call her if im not able to meet her…

In these holidays, all the time I thought and kept planning that how could I meet her… jus to my luck there came our alumni party!!!!! guess what she was also coming I was very much exited … to see her then came the day of the party… me with my frens planned to freak out before going to the party… but to my surprise they had planned something else we went to a pub n my friend threw a cocktail party… I drank vodka + whisky + beer n now what I was feeling dizzy… then somehow we went to the party… we danced a lot there I saw her also but didn’t went to her cause I have never thought of a situation like this (being drunk n talking to her)… So we had our dinner n came back…

After that ….. night I cursed myself for joining in the cocktail party… Since then I am in contact with her but v rarely get time to talk…

PS : This story was fictional and an imaginative creation of my mind, it has no relation with real life…

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!