Friday, July 1, 2011

On maximizing the expectation of the sum of logarithms of sums of products of Multinomial Distributions with Dirichlet priors...

July 1: Math is Hard...

Happy Canada Day everyone!  Nothing much happened for Canada Day here except for a 100円 special on curry rice and a 150円 special on katsu at the company cafeteria, which wasn't even for Canada Day.  I'll take it though!  Yum...

I woke up and had dorm breakfast of salmon(!!) and oroshi and something black and thin haha.  The flavour of the blank things was mild and a bit like gobo-kinpira (marinated burdock root), though not as good.  There was also some miso soup with a MILLION bricks of tofu in it and rice of course.

I got to work early again today and coded my PLSA recommender.  The coding of the program itself went very smoothly, but the debugging was a NIGHTMARE, because it takes so long to fail.  Many of the computations effectively belong to a high complexity class (ok ok they're just low-degree polynomials, but they're not order logn, n, nlogn or n^2), which makes debugging take quite a while, especially when it decides to fail after 10 iterations of various additions and multiplications across 20 latent variables (which are drawn from a ~1000x2000 nested Hash, whatever Ruby means by Hash), where those values each are multiplied by two probabilities (both drawn from ~1000x2000 nested Hashes as well).  Eugh.  I'm glad I'm using a "small" corpus.  D:

I eventually got it to work, though I am afraid to admit I'm not sure what change exactly made it start behaving, as I changed two things at once because I was pretty sure neither were going to do anything and then it started working.  >_<  I was pretty fed up with it, so I showed Kabutoya-san that it worked and then we moved on haha.  I'm glad I'm learning a lot, because otherwise spending 4 hours (how did it take that long!?) debugging a system that made three successful recommendations for the same user on toy data from the late 90s, the actual results of which neither Kabutoya-san nor I care about, would be really frustrating.  But I AM learning a lot, so it's actually quite fulfilling. XD  I then moved onto something more mathematically complicated, that will, however, not take longer to run (I hope).  However, I'll be using data from a database on the network rather than data stored in memory (I smell "judicious caching" coming my way!), so that might make things slower.

At lunch I managed to play successful non-beach-style handiball!  Hooray!  It was a heartening experience, because I was kind of dreading going back to full handiball after enjoying beach so much more.  For lunch I had said katsu-curry combo for 250円, and it was very good.  At the cafeteria they make the curry roux a bit more similarly to how Dad and I make it more than most other Japanese establishments I've been to.  Odd.  While eating I told my coworkers information about Canada for Canada Day haha.  I told them that we gained independence from Britain in 1867 by mutual agreement, unlike the USA, and that we were still dependent on Britain for foreign policy and international affairs until after WWI (which at least *think* is correct).  I told them that Canada was first colonized by the French, but the British gained control of France's North American colonies during one of their numerous conflicts, which is why Canada is mainly Anglophone, except for the oldest part, Quebec, which is dominantly Francophone.  I also told them that the United States had more conflict with Britain due to the taxation on their productive raw materials industry (such as cotton and dyes) than Canada did, which is why we stayed joined to Britain and are still considered to be a constitutional monarchy with the Queen as our symbolic head of state.  The people I was sitting with seemed to find this pretty interesting, or at least they were being very gracious haha.

In the remainder of the afternoon (after I finished my debugging) I started working on the math for a Multinomial-Mixture-model-based recommender system (this is what Kabutoya-san called it), which is a combination of the PLSA thing I did before, but with a change in the definition of the latent variables, and with a Dirichlet prior placed on the parameters of the model.  This change of latent variable definition caused much headache, and when I went to ask Kabutoya-san, he took a few tries before getting it right, so I don't feel *too* bad (at all, actually) about messing it up!  My background in probability is really weak, so when determining the expectation of a sum of logarithms of summations of products, I am tres screwed.  The terms associated with the Dirichlet prior thankfully mind their own business on the other end of the equation haha.  I am going to look into if there are any English textbook stores accessible in Tokyo, as I don't recall liking my probability textbook at home that much (not that I read it that much, clearly haha).

After work I came home and ate dorm supper of korokke with assorted raw vegetables (tomato, cabbage, etc) and some strange sort of konnyaku-esque white thing on spinach.  It was pretty good, but I am still sad about the lack of tea.  D:  I set out for Yokochuu after supper, but I got to the stop a minute after the bus had come, and the next one wasn't due for half an hour.  Combined with the fact that I had just drawn up a budget for myself that day, I decided this was a sign and came back to my room to e-mail people and blog and install Touhou (bullet-curtain game like Mushihime but with better music, less purple and fewer insects, clearly) 12 and 12.5.  I think after blogging I'll play Touhou to console myself over the loss of a night of Project Diva in Yokochuu.  ;D  At least until I'm too frustrated at how much I suck to continue ahahaha.  Tomorrow I might go try to get my own Internet connection happening.  Kabutoya-san suggested Yodobashi Camera, I assume because they will expect foreign customers a little more than bum-nowhere-R-us in Yokochuu (at least compared to Tokyo).

Ciao!

No comments:

Post a Comment