tag:blogger.com,1999:blog-68014513648363423442018-12-26T18:31:42.346-08:00Stefanos NikolaidisStefanos Nikolaidishttp://www.blogger.com/profile/13864424837958934671noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-6801451364836342344.post-30297724513869809462018-12-26T18:31:00.002-08:002018-12-26T18:31:42.301-08:007 Rules of the Grad School Game<div dir="ltr" style="text-align: left;" trbidi="on"><span style="color: #6fa8dc; font-size: x-small;"><b><i> 5 minute read</i></b></span><br /><br /><span style="font-family: "times" , "times new roman" , serif;">In a dinner after a conference last spring in Chicago, several graduate students asked me if I had any advice about success in graduate school. I kept thinking of this question, mostly during my evening runs, and I decided to compile my thoughts into a set of rules. </span><span style="font-family: "times" , "times new roman" , serif;">I did not include things such as exercising, having a schedule, waking up at the same time etc, mostly because they are common knowledge and I have never been good at them anyway. </span><span style="font-family: "times" , "times new roman" , serif;">I picked the rules system because (1) this seems to be the trend nowadays and (2) rules are easy to remember. </span><br /><span style="font-family: "times" , "times new roman" , serif;"><br /></span><span style="font-family: "times" , "times new roman" , serif;"><b>1. Go to the cocktail party. </b>In academia, information is the valued currency. A solid advice can save you months of unnecessary hustle. Students will speak about advisor habits, research, classes etc. Staff will tell you which rules of the institution are strictly enforced and which can be casually broken. Professors will speak about general research trends, their students, lab equipment that you could possibly use. Not only that, but by clearly articulating your research, your goals, your hurdles, things that you are stuck, you bring structure to thoughts and encourage others to do the same. Be social and go to the party. </span><br /><br /><span style="font-family: "times" , "times new roman" , serif;"><b>2. Choose the right game. </b>You joined a new lab, working on a direction that your advisor has little experience. You are asked to publish a high-quality paper in a year, competing in a domain where hundreds of senior researchers in large research institutions have been working in large teams for years. This is a game that you are -- more often than not -- not going to win. A game that you cannot win is rigged. <a href="https://www.youtube.com/watch?v=K0omu7x_LbU">Do not play a rigged game.</a> Instead, design a new one: bring insights from different fields; find external collaborators; identify a niche that is less explored. Choose a game that is challenging but that you are likely to win. </span><br /><div><br /></div><span style="font-family: "times" , "times new roman" , serif;"><b>3. Make a good first impression. </b>A student that excelled in the first term but had bad performance in the second probably overextended by trying too hard. A student that had bad performance in the first term is a mediocre student who may improve -- if lucky enough to be given the chance. First impression defines the initial expectations, and expectations are not easy to change. Apply maximum effort in your first research project, your first review, your first submitted paper. Make a great first impression. </span><br /><div><br /></div><span style="font-family: "times" , "times new roman" , serif;"><b>4. Be precise.</b> Research is hard, and if you are pushing yourself, you will inevitably feel at some point overwhelmed. Things will break -- especially if you work on robots and you are running a demo and your advisor is nearby -- and progress may seem like climbing a shadowy mountain. To be prepared for this time, be precise about everything. What you want to achieve, how to formulate the problem, what method you use, when and how it breaks. Precision imposes boundaries and form to the undefined. The shadowy mountain will start having a concrete shape, and it may even reveal paths that you can hike. Be precise. </span><br /><div><br /></div><span style="font-family: "times" , "times new roman" , serif;"><b>5. Run the extra mile. </b>Once things start working, research can actually be incredibly rewarding and fun -- for the most part. The last 20% of the effort in any project is usually the hardest and most tedious part. </span><span style="font-family: "times" , "times new roman" , serif;">Arnold Schwarzenegger said that the last three reps are what makes the muscle grow.</span><span style="font-family: "times" , "times new roman" , serif;"> It is</span><span style="font-family: "times" , "times new roman" , serif;"> then that you get a deep understanding of the topic. It is also what makes a </span><span style="font-family: "times" , "times new roman" , serif;">good paper into a great paper. </span><span style="font-family: "times" , "times new roman" , serif;">And a great paper is orders of magnitude more valuable than a good paper. Rerun the statistical tests. Check for patterns in the data. Refine the figures. Don't be like everyone else. Run the extra mile. </span><br /><br /><b style="font-family: Times, "Times New Roman", serif;">6. Be aware of a distorted lens</b><b>.</b><b style="font-family: Times, "Times New Roman", serif;"> </b><span style="font-family: "times" , "times new roman" , serif;">Every scientific method has strengths and weaknesses. These are typically identified in an objective manner, by comparing to existing work, to an ideal baseline or to a well-defined goal. Focus, on the other hand, can be much more subjective and biased: a reviewer or an audience member can choose to disregard weaknesses and emphasize strengths, or vice versa. </span><span style="font-family: "times" , "times new roman" , serif;">Every time you receive feedback that appears overly critical, ask yourself and others whether it is an objective assessment of the work or a result of shifted focus. Embrace and learn from all feedback, positive and negative, and adapt your work and your viewpoint. But be unaffected from criticism through a distorted lens. </span><br /><span style="font-family: "times" , "times new roman" , serif;"><br /></span><span style="font-family: "times" , "times new roman" , serif;"><b>7. Smile. </b>As a first-year graduate student, with little research experience and published track record, you are at the bottom of the academic pyramid. But you have youthful energy and excitement that is scarce in an environment where people can be easily stressed and overworked. Maximize that. Be the source of radiant energy, the person who is optimistic when things break, relaxed when everyone else is on edge and who is cracking jokes at 2am. Make your advisor happy to have meetings with you. </span><span style="font-family: "times" , "times new roman" , serif;">Be polite and kind to everyone, including other students, administrative stuff, cleaners. You need them more than they need you, and by being pleasant to be around, you encourage everyone else to do the same. Have fun. Smile. </span><br /><span style="font-family: "times" , "times new roman" , serif;"><br /></span><span style="font-family: "times" , "times new roman" , serif;"></span><br /><span style="color: #6fa8dc; font-size: x-small;"><b><i>This post is inspired by past discussions with Siddhartha Srinivasa, David Hsu, Julie Shah, Seth Cooper, and many others that I cannot remember. </i></b></span><br /><div><span style="color: #6fa8dc; font-size: x-small;"><b><i><br /></i></b></span></div></div>Stefanos Nikolaidishttp://www.blogger.com/profile/13864424837958934671noreply@blogger.com0tag:blogger.com,1999:blog-6801451364836342344.post-10944864023423303122018-08-13T15:02:00.000-07:002018-09-25T20:35:40.263-07:00A brief introduction to Partially Observable Markov Decision Processes<div dir="ltr" style="text-align: left;" trbidi="on"><span style="color: #6fa8dc; font-size: x-small;"><b><i> 15 minute read</i></b></span><br /><br />In this summary, I assume you are familiar with <a href="http://www.incompleteideas.net/book/ebook/node33.html">Markov Decision Processes</a>. In a Markov Decision Process (MDP), an agent interacts with the environment, by taking actions that induce a change in the state of the environment.<br /><br /><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; margin-left: 1em; text-align: right;"><tbody><tr><td style="text-align: center;"><a href="https://3.bp.blogspot.com/-CivlA5YHBVc/W0LiLuCn4SI/AAAAAAAAAlA/qm6CoKcwf0wVwrm-Mr8aGNTeb9sxC76xACLcBGAs/s1600/HERB.jpg" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" data-original-height="765" data-original-width="1028" height="147" src="https://3.bp.blogspot.com/-CivlA5YHBVc/W0LiLuCn4SI/AAAAAAAAAlA/qm6CoKcwf0wVwrm-Mr8aGNTeb9sxC76xACLcBGAs/s200/HERB.jpg" width="200" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">MDP: The robot knows the position<br />of the fuze bottle.<br /><i>Image courtesy of</i><i style="font-size: 12.8px;"> </i><i>the </i><br /><i>Personal Robotics Lab</i> [6, 7] </td></tr></tbody></table>For instance, a robotic arm may grasp a fuze bottle from the table and put it on the tray. The goal of the agent is represented in the form of a reward that the agent receives. In our example, if the robot succeeds in picking up the object, it gets a positive reward. If it fails and drops the object, it receives a penalty. The goal of the agent is to maximize the reward it will receive throughout the task.<br /><br />An important assumption in MDPs is that the agent knows the true state of the world. So, our robotic arm would know exactly where the soda can is located. Partially Observable Markov Decision Processes relax this assumption, in that the agent does not know the true state, but can receive observations through its sensors that enable it to <i>estimate </i>that state.<br /><br /><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; text-align: right;"><tbody><tr><td style="text-align: center;"><a href="https://3.bp.blogspot.com/-VT3i21rWlDI/W0Ligza2lXI/AAAAAAAAAlI/F4hu1ycfgmQZrPqH2fTXCuNGR7dgxEq9wCLcBGAs/s1600/HERB_unc.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" data-original-height="765" data-original-width="1028" height="147" src="https://3.bp.blogspot.com/-VT3i21rWlDI/W0Ligza2lXI/AAAAAAAAAlI/F4hu1ycfgmQZrPqH2fTXCuNGR7dgxEq9wCLcBGAs/s200/HERB_unc.png" width="200" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">POMDP: The robot retains a <br />probability distribution over <br />possible fuze bottle locations.<br /><i>Image courtesy of</i><i> the </i><br /><i>Personal Robotics Lab</i> [6, 7] </td></tr></tbody></table>Specifically, the agent will maintain a belief state $b$, which is a probability distribution over world states. The agent starts with an initial belief $b,$ it chooses an action $a$ based on that belief, and receives an observation $o$. It then computes a new belief $b'$ based on the previous action and observation, and so on.<br /><span style="font-size: 12.8px;"><br /></span>For each state and action, the agent receives a reward $r_t$. As in the case of MDPs, the goal of the agent is to maximize the expected accumulated reward that it will receive over a time horizon $T$:<br /><br />\begin{equation}<br /><br />\mathbb{E}\left[ \sum_{t=0}^{T-1} r_t \right]<br /><br />\end{equation}<br /><br />Formally, we define a partially observable Markov decision process as a tuple $<S, A, \mathcal{T}, \Omega, O, R>$, where:<br /><br />$S$: finite set of world states; in our example, that is the set of possible robot configurations and positions of the fuze bottle.<br />$A$: set of a robot actions; for our robotic arm, an action can be a displacement of the robot end-effector as well as a grasping action.<br />$\mathcal{T}$: $S \times A \rightarrow \Pi(S)$ is a state-transition function, mapping a world state and robot action to a probability distribution over states. It represents how the true world state changes given a robot action; in our example it encodes the uncertainty in the motion of the robot and of the fuze bottles.<br />$\Omega$ is a finite set of observations; for the object manipulation example, it can be a set of possible point clouds from a depth sensor or readings from the contact sensors in the robot's fingers.<br />$O: S \times A \rightarrow \Pi(\Omega)$ is the observation function, which maps a world state and robot action to a probability distribution over observations. It represents the uncertainty in the observations by the robot's sensors.<br />$R: S \times A \rightarrow \mathbb{R}$ is a reward function that the agent receives given an action at a particular world state, for instance a positive reward if the robot succeeds in picking up the object and a negative reward for robot failure.<br /><div><br /></div>After the robot takes an action $a$ and an observation $o$, it can compute a new belief $b'$ as follows:<br /><br />\begin{align}<br /><br />b'(s') &= P(s'|o, a, b) \\<br /><br /> &= \frac{P(o | s', a, b) P(s' | a, b)}{P(o | a,b)} &(\textit{from Bayes' rule}) \\<br /><br /> &= \frac{P(o|s',a,b) \sum_{s \in S} P(s' | a,b,s)P(s | a, b)}{P(o | a, b)} & (\textit{marginalization})\\<br /><br /> &= \frac{P(o|s',a) \sum_{s \in S} P(s' | a, s)P(s | b)}{P(o | a, b)} & (\textit{from conditional independence})\\<br /><br /> & = \frac{O(s',a, o) \sum_{s \in S} \mathcal{T}(s, a, s') b(s)}{P(o|a,b)} & (\textit{by definition of $~\mathcal{T},O,b$})<br /><br />\end{align}<br /><br /><br />Now, how should the agent optimize its expected accumulated reward? The agent can control only the action $a$ that it will take, given its belief $b$. We call the policy of the agent a mapping from beliefs to actions:<br /><br />$\pi: B \rightarrow A$<br /><br />The optimal policy $\pi_t^*(b)$ is the policy that returns the optimal action, that is the action that maximizes the expected reward that the agent will receive over the next $t$ steps.<br /><br />To understand the computation of the optimal policy, we need to first note the concept of a policy tree. A policy tree $p$ is a tree describing sequences of actions and observations. Each arc in the tree is labelled with an observation, and each node with an action to be performed when the observation leading to that node is received.<br /><iframe height="300" src="https://drive.google.com/file/d/1ciQV4Y61Pfsn8fh8vmnZQ6Omg4I88zop/preview" width="640"></iframe> <br />Now, to compute the optimal policy, we need a metric of how good a given policy tree p is. The value of executing a policy tree p in state s is the immediate reward by executing the action $a(p)$ at the root node of the tree, plus the expected value of the future.<br /><br />\begin{align}<br /><br />V_t^p(s)&= R(s,a(p)) +(\textit{Expected value of the future})<br /><br />\end{align}<br /><br />The value of the future depends (i) on which state the agent will end up, and (ii) on which observation $o_i$ the agent will make. The agent does not have this information in advance, so we will take the expectation over subsequent states and observations: \begin{align}<br /><br />V_t^p(s)&= R(s,a(p)) + \sum_{s'\in S} P(s'|s, a(p)) \sum_{o_i \in \Omega} P(o_i|s',a(p)) V_{t-1}^{p,o_i}(s')<br /><br />\end{align}<br /><br />Based on our definitions of the transition function $\mathcal{T}$ and observation function $O$, we have:<br /><br /> \begin{align}<br /><br />V_t^p(s)&= R(s,a(p)) + \sum_{s'\in S} \mathcal{T}(s, a(p),s') \sum_{o_i \in \Omega}O(s', a(p),o_i) V_{t-1}^{p,o_i}(s')<br /><br />\end{align}<br /><br />We see that the value of a state can be computed by one-step look-ahead using $V_{t-1}$. We can then compute the value for every state $s$ recursively, using dynamic programming [4] .<br /><br />Sadly, the agents does not know the true state, but has a belief $b$, which is a probability distribution over states. Therefore, we need to compute the value of executing a policy tree $p$ given an agent belief $b$. We do this by marginalizing over the agent's belief $b$:<br /><br />\begin{align}<br /><br />V_t^p(b) &=\sum_{s \in S} b(s) V_t^p(s)<br /><br />\end{align}<br /><br />We can write the above equation more compactly by writing the sum as an inner product of the belief with a set of vectors $\alpha_t^p = <V_t^p(s_1), ... , V_t^p(s_n)>$<br /><br />\begin{align}<br /><br />V_t^p(b) = b \cdot \alpha_t^p<br /><br />\end{align}<br /><br />So, we see that a policy tree $p$ is associated with a set of vectors $\alpha_t^p$, which we call "alpha vectors." We have also computed the value of a given policy tree $p$ given a belief $b$.<br /><br />So, given a set of $t$ step policy trees $P_t$, we can compute the value of the optimal policy as the value of starting in belief $b$ and executing the best policy tree in that belief:<br /><br />\begin{align}<br /><br />V_t(b) = \max_{p \in P_t} b \cdot \alpha_t^p \end{align}<br /><br /><br />This is equivalent to to executing the best root action at time $t$, and the best assignment of policy trees -- and their corresponding $\alpha$ vectors -- at $t-1$:<br /><br />\begin{align} V_t(b) = \max_{a \in A}\left [ \sum_{s \in S}R(s,a)b(s) + \gamma \sum_{o_i \in \Omega} \max_{\alpha \in P_{t-1}} \sum_{s \in S} \sum_{s'\in S} P(o_i|s',a)P(s'|s,a)b(s) \alpha(s') \right ] \end{align}<br /><br />The equation above can be solved with exact value iteration: start with a set of $t-1$ step policy trees, and iteratively use that to construct a superset of $t$ step policy trees. Unfortunately, the size of the policy trees grows exponentially at each step. We have |A| actions, and for every action we need to consider $|P_{t-1}|^{|\Omega|}$ new trees at each step. This makes solving it intractably large over time.<br /><br />Instead, we can use sampling-based algorithms to find efficiently approximate solutions. Most such algorithms alternate between sampling in belief-space, and performing an one-step look-ahead, which propagates the information of the children of $b$ back to the point $b$.<br /><br />Here is an example of how this is possible [3]: Let's assume a sampled set of belief points $b \in B$, and substitute $\alpha^{a,*}=R(s,a)$ and $\alpha^{a,o_i}= \sum_{s'\in S} P(o_i|s',a)P(s'|s,a)$. Then, we can rewrite the value function as:<br /><br /><br />\begin{align} V_t(b) =\max_{a \in A}\left [ \alpha^{a,*}\cdot b + \sum_{o_i \in \Omega} \max_{\alpha^{a, o_i} \in P_{t-1}} \alpha^{a, o_i}\cdot b \right] \end{align}<br /><br /><br />Then, for each sampled belief $b$ we can compute the best $\alpha^{a, o_i}$ and store it ahead of time. Then, each time we update the value at $t$ from $t-1$ policy trees, we only need to consider |A| new trees!<br /><br />This however begs the question, what beliefs should we consider to sample? Recent algorithms [5] have achieved dramatic performance improvements, by attempting to sample from the belief space that is reachable by the optimal policy, since it is usually much smaller than the full belief space.<br /><br /><span style="color: #6fa8dc; font-size: x-small;"><b><i>We thank Siddhartha Srinivasa and Vaibhav Unhelkar for their feedback. </i></b></span><br /><span style="color: #6fa8dc; font-size: x-small;"><b><i><br /></i></b></span><br /><h4>References</h4><br /><span style="font-size: x-small;">[1] L. P. Kaelbling, M. L. Littman, and A. R. Cassandra. "Planning and acting in partially observable stochastic domains." Artificial intelligence, 1998.</span><br /><span style="font-size: x-small;">[2] N. Roy, 16420: Planning Under Uncertainty, Massachusetts Institute of Technology, delivered Fall 2010.</span><br /><span style="font-size: x-small;">[3] J. Pineau, G. Gordon, and S. Thrun. "Point-based value iteration: An anytime algorithm for POMDPs." IJCAI, 2003.</span><br /><span style="font-size: x-small;">[4] D. Bertsekas, Dynamic Programming and Optimal Control, Athena scientific, 1995.</span><br /><span style="font-size: x-small;">[5] H. Kurniawati, D. Hsu, W. Sun Lee. "SARSOP: Efficient Point-Based POMDP Planning by Approximating Optimally Reachable Belief Spaces." Robotics: Science and Systems, 2008.</span><br /><span style="font-size: x-small;">[6] Michael Koval. "Robust Manipulation via Contact Sensing." PhD Thesis. Carnegie Mellon University, 2016. </span><br /><span style="font-size: x-small;">[7] <a href="https://personalrobotics.cs.washington.edu/">Personal Robotics Lab</a>. University of Washington, 2018. </span><br /><br /><div><div></div></div></div>Stefanos Nikolaidishttp://www.blogger.com/profile/13864424837958934671noreply@blogger.com