<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Thoughts and Notes - Medium]]></title>
        <description><![CDATA[About life, computer science and other things I enjoy - Medium]]></description>
        <link>https://medium.com/thoughts-and-notes?source=rss----2939c491f2d7---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Thoughts and Notes - Medium</title>
            <link>https://medium.com/thoughts-and-notes?source=rss----2939c491f2d7---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 20:40:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/thoughts-and-notes" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Code quality in academic research]]></title>
            <link>https://medium.com/thoughts-and-notes/code-quality-in-academic-research-bf9338e6ac7c?source=rss----2939c491f2d7---4</link>
            <guid isPermaLink="false">https://medium.com/p/bf9338e6ac7c</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[research-reports]]></category>
            <dc:creator><![CDATA[Wesley Wei Qian]]></dc:creator>
            <pubDate>Sat, 13 Feb 2016 06:01:55 GMT</pubDate>
            <atom:updated>2016-02-14T04:44:12.042Z</atom:updated>
            <content:encoded><![CDATA[<p>As a computer science undergraduate, I am trained to write maintainable, refactored and well-documented high quality code because that’s the industry standard.</p><p>However, in academic research, writing code is about making experiments and proving a point. Therefore, code is sometimes written in an “ASAP” manner: no commenting, bad-structured and probably lots of for loop if you have a formula with lots of summation symbol.</p><p>People seem to be OK with it. In the end of the day, academic research is more about idea and people won’t use your code anyway.</p><p>But I after some rather “frustrating” experience, I have a different take on this.</p><h4>Your idea will develop, and your code should be ready to adapt.</h4><p>In research, we tend to write code in a stream line fashion. If I want something, I just write down the script, run it and throw it away.</p><p>Therefore, I wrote many python scripts with no function, no module and sometime no comment. I did get to start my experiment very soon into the project, but the debts ended up biting me.</p><p>So one month into the experiment, I came up with another exciting idea andI need to extract a different features from the original data. However, when I opened up the scripts I wrote before, I had no idea where I should start and there was no a good place for coding up my new features. In the end, I wrote a new script with lots of copy and paste. It is inefficient and frustrated.</p><p>In software engineering, one huge reason why we care about modulation and object oriented programming is because they are easy for us to add new features and refactor our code. I think the same idea should also apply to academic research, except “new features” in research is “new idea”.</p><p>It is inevitable to develop new ideas during research (and that’s why it’s so fun) and having modulated code that can easily adapt your new idea will save you a lot of time.</p><p>This semester, we started a natural language processing project and my first step is to convert Chinese sentence into Word2Vec data.</p><p>Instead of writing the code right away, I start by imaging a preprocessing pipeline with data packet and modification components and end up writing a rather complex preprocessing pipeline: a Sentence class where I can store all the features I want, functions that can calculate/produce this features and a output component which can take in a list of Sentence class and give me a file according to my configuration.</p><p>The script takes my whole afternoon, but when I have a new feature idea in the future(as it often happens in computational linguistic), I just need to add a field to my Sentence class, a function to extract the features, and plug it in my output component. This is definitely faster than writing a new script.</p><p>Plus, it makes me feel better…</p><h4>While correctness is often more important than performance in research, bad performance code can obstruct your correctness.</h4><p>“Let’s make this work first.”</p><p>In research, we often care more about whether the model work than how long does it take to run, so more often than you can imagine, you will see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*LT18oFx-8SXVrMKRkfMI7A.png" /><figcaption>A snapshot of a nested-nested-nested-nested-nested for-loop in my Matlab code</figcaption></figure><p>And it costs me.</p><p>People familiar with Matlab know that nested for loop generally have a worse performance than matrix operation. But when your formula has four summation symbols and your data is layout in a complex way, it takes a lot of engineering power to convert such for loop into matrix operation. When you are in a fast pace, you probably will be reluctant to pay such effort.</p><p>Last summer, I started writing a spatial pattern recognition model based on a paper my advisor wrote and we hope to apply this model to protein domain matching. I finished the coding very quickly and the model works perfectly when we have a relatively small size samples. Since the model requires a lot of computational power with these kind of nested for loop, we are not able to test it on larger size samples. But the math makes sense and the code is working, so we move on to the next stage happily and decide to worry about the performance later.</p><p>However, when we are forced to <a href="https://medium.com/thoughts-and-notes/ml-my-first-with-parallel-computing-de0518542aac#.s62fewyde">improve the performance</a> later, we discover some problem that we have never thought of. Wrong that we could not discover because of the code performance.</p><p>This is really a trade off problem instead of a yes or no problem. In the end, all we want is using the shortest time to develop a good enough performance and confirm our model. But how do we define “good enough”? I guess the answer can only come with experience.</p><h4>Research is a community effort, so your code should be for the community</h4><p>Recently, I took over a project from a graduating PhD and get into a situation like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*X0hCdPUCJ6bkChzCklmb6w.gif" /><figcaption>In his defense, he has a lot of pressure on time and he tries his best.</figcaption></figure><p>People often complain that academic research is done in the dark far too often. Therefore, many brilliant and inspiring ideas fail to generate traction and end up in some dark corner of the internet, which is really really sad.</p><p>Today, many open source projects get to thrive on Github and help many many developers because they are maintained by many many people. Because of the well documentation, people are happy to help.</p><p>On the other hand, if your code has no comment and no documentation, people will just find it painful to work on your code and probably will start from scratch if they have to.</p><p>Research is a community effort, and people should not redo another’s work just because there isn’t a documentation. I mean, who don’t want to read a document like this and avoid writing two months worth of code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*bVAK5PDwdlnr0jFipTkAtQ.png" /><figcaption>The repo is currently in private status</figcaption></figure><p>Again, it makes me feel better …</p><p>Sometimes, we really should just go for that extra mile.</p><p><em>Followings are some discussions I found on the web that are also worth reading if you are already at the end of this.</em></p><p><a href="http://academia.stackexchange.com/questions/21276/best-practice-models-for-research-code"><em>Best-practice models for “research” code?</em></a></p><p><a href="http://stackoverflow.com/questions/2685227/how-can-i-write-good-research-code"><em>How can I write good “research code”?</em></a></p><p><a href="http://academia.stackexchange.com/questions/17781/why-do-many-talented-scientists-write-horrible-software"><em>Why do many talented scientists write horrible software?</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf9338e6ac7c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thoughts-and-notes/code-quality-in-academic-research-bf9338e6ac7c">Code quality in academic research</a> was originally published in <a href="https://medium.com/thoughts-and-notes">Thoughts and Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Product Managing Training]]></title>
            <link>https://medium.com/thoughts-and-notes/a-product-managing-training-af7ca75aac5c?source=rss----2939c491f2d7---4</link>
            <guid isPermaLink="false">https://medium.com/p/af7ca75aac5c</guid>
            <category><![CDATA[education]]></category>
            <category><![CDATA[product-management]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Wesley Wei Qian]]></dc:creator>
            <pubDate>Tue, 22 Dec 2015 17:13:11 GMT</pubDate>
            <atom:updated>2015-12-22T14:40:59.653Z</atom:updated>
            <content:encoded><![CDATA[<h4>Intro</h4><p>In the passing semester (Fall 2015), I did a field project with <a href="http://www.demandware.com/">Demandware</a> and <a href="http://www.brandeis.edu/facultyguide/person.html?emplid=69957fcf6528db656418863916878ea0e4046b09">Professor Pito Salas</a> at Brandeis University. It is a very different project than a normal programming project assigned in class, and I, therefore, have a lot of fun and learn a lot. I won’t go into the detail of this project here, but you can visit our <a href="http://brandeisxdemandware.github.io/">landing page</a> if you are interested.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DrotSd9V2Kx1U8L0.jpeg" /></figure><h4>A Product Managing Point of View</h4><p>Demandware is a software technology company providing a cloud-based e-commerce platform and in this project, they are interested in exploring solutions and technologies to enhance customer’s shopping experience in physical retail store.</p><p>“Solutions and technologies to enhance customer’s shopping experience in physical retail store” is really all we got from Demandware in the beginning. It is a broad topic and very open ended. And as any creative, passionate college kids, my teammates and I went wild and just brainstormed on a Google Doc. In our initial meeting, we basically throw a list of “amazing” ideas to the Demandware team. At that meeting, I got two very simple questions that I cannot answer and learnt a lesson I would not learn from an ordinary Computer Science class.</p><p><strong><em>1 Why do you think these ideas will work? Do you have any research or survey data?</em></strong></p><blockquote>“Ideas are cheap and plenty. Regardless of how great your idea is, there are probably dozens (if not, hundreds) who have had it before you (but, failed to execute).”</blockquote><p>I always thought the such “execution” is just about implementing, but the reality is, the first execution step is actually check your idea. This is a little mind blowing for me. With very little industry exposure, I thought building a product will just be two steps: come up with a feature, and implement it. This is how we do our programming assignment at least: I need to support a function, so I come up with an idea and start implement it in a different branch, I merge if it works and I rollback if it doesn’t. Simple as that. But for software engineer company, when they need to come up features to solve problems, they can’t really worth to push their features or ideas to scale without any testing. So, that’s the first question they ask: how do you support your “million dollars” idea?</p><p><strong><em>2 What’s most important ideas in the list? What’s the key idea?</em></strong></p><p>We have a list of amazing ideas, but we don’t know how answer this question because we don’t know what exactly the question is: it is a broad topic with a open ending. We got a question and we answered it. This will work fine in a ordinary computer science assignment because the question we got are usually very specific and we just need to answer it.</p><p>However, in reality, such problem solving involves a process more like writing a paper. We have a general question we want to solve, in our case will be, “What solutions and technologies are there to enhance customer’s shopping experience in physical retail store?” The next step will then be narrow down the problem, for example, “what are the key problem in today’s retail store and how can we fix it?” Once we have a more narrowed problem, we need to ask is this a good problem to solve? Is this problem important enough? Lastly, what is your paper thesis, in other words, “What’s your solution?”</p><p>Today we have thousands of start ups are there calming they are solving a problem or even problems, but only a small fraction of them are getting successful, I think the key difference is how good their “problem” is.</p><p>Today, it is very easy for a group of people to come up hundreds or even thousands of ideas. But these random ideas coming from everywhere won’t get us anywhere. Creating a product, or a startup, is not really about how many ideas you have. Instead, it is more about identify the key problem in today’s world and find a great way to solve it.</p><p>Not many successful start up ideas are random, there are often a very through thinking process behind that people don’t really realize.</p><h4>A Software Engineer/Computer Scientist Point of View</h4><p>But how is such information beneficial to a computer science student if she is aiming for a career as a software engineer or a computer scientist instead of a entrepreneur or a product manager?</p><p>I think the key goes to the problem solving skill training. As a computer scientist, we learn recursion, dynamic programming, etc. to train our problem solving skills because these are some of the good way to understand and conquer a specific question. However, in reality, engineering is not just about traversing a tree, instead, you probably will get a more generic questions like design a X system to achieve Z.</p><p>To answer such question, you will probably need years of experience and a very good understanding of the existing system, but more importantly you will need to answer a similar question I mentioned above: “What is the key problem you are solving?” and “What’s your solution to that problem?”</p><p>When we are coming up ideas in our project, I started to do some coding as a proof of concept and learned a very valuable lesson, that is “how to locate the major technical difficulty behind an idea? what is the key technology to overcome the obstacle?” This thinking process is rare when I did programming assignment for classes because we know professor assign this project for a recent topic and we just need to implement that. Therefore, we don’t really have enough training to answer a question like “design a X system to achieve Z” and I learn a lot about this in this field project.</p><p>I used to think that product managing courses are not really worth taking, but it turns out that I love it, enjoyed it and highly recommend it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af7ca75aac5c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thoughts-and-notes/a-product-managing-training-af7ca75aac5c">A Product Managing Training</a> was originally published in <a href="https://medium.com/thoughts-and-notes">Thoughts and Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My First with Parallel Computing]]></title>
            <link>https://medium.com/thoughts-and-notes/ml-my-first-with-parallel-computing-de0518542aac?source=rss----2939c491f2d7---4</link>
            <guid isPermaLink="false">https://medium.com/p/de0518542aac</guid>
            <category><![CDATA[matlab]]></category>
            <category><![CDATA[parallel-computing]]></category>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Wesley Wei Qian]]></dc:creator>
            <pubDate>Tue, 22 Dec 2015 17:13:01 GMT</pubDate>
            <atom:updated>2015-12-09T22:16:18.827Z</atom:updated>
            <content:encoded><![CDATA[<h4>Intro</h4><p>“Big data is like teenage sex: everyone talks about it, nobody really knows how to do it, everyone thinks everyone else is doing it, so everyone claims they are doing it…” — Dan Ariely</p><p>And the same quote can apply to many other related terms with big data like machine learning, deep learning, data visualization and parallel computing. Fortunately, I did get a chance to <strong>do</strong> one of them recently.</p><h4>How I Get Into This Whole Parallel Computing Business?</h4><p>Over the pass summer, I have been doing some research and implemented an approximate algorithm for efficient graph matching. Utilizing this algorithm, I later developed a spatial pattern matching model following the research of my mentor Prof. Hong.</p><p>Even though the graph matching runs relatively fast, it still takes about 30 mins to match two graphs with about 100 nodes and such matching is needed to run several rounds in our model developing algorithm. As bad as it sounds, we were actually quiet happy with our progress at that point and we were able to demonstrate the viability of our model through small sample set.</p><p>I mean, every computer science problem is not a problem until we need to scale.</p><h4>But,</h4><p>Going into this fall, we decided to apply the algorithm to biology domain and aim to solve a fascinating yet challenging problem: generate a model to learn the common domain across all the sample proteins. We convert sample protein crystal structures into graphs and hope to understand the common structure in this sample protein utilizing our algorithm. This is a fascinating job. I mean, look at this beautiful matching graph:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EBM8bNX6xSitU7vo.png" /></figure><p>But we run into a problem: the scaling problem. Most of the proteins have hundreds of amino acids and give us a graph with hundreds of nodes. Therefore, we need to make our graph matching faster. Since the majority time for running the graph matching algorithm is used to build a huge matrix storing the edge compatibility between all the edges of two graphs. The work can be huge once we scale. Let’s say we have a graph with A nodes and another graph with I nodes. Then there will be at most A*A edges in the first graph and I*I edges in the later. Therefore we will need to compute a huge matrix with size (A*A)*(I*I). That’s a lot of work, but luckily the computing order does not matter, so we decide to try parallel computing.</p><h4>The Parallel Computing Toolbox in MATLAB</h4><p>MATLAB has this amazing parallel computing toolbox that can help you utilizing multiple CPU on your local machine or clusters to do parallel computing by simply change your for loop to parfor loop. That sounds pretty straight forward and that’s what I thought when I first looked at the tutorial.</p><p>However, the complication in parfor is the way we can index our matrix. It is limited. Here are some legal cases if we want to assign a value to our (A*A)*(I*I) matrix C.</p><pre>C(2,7)=1;<br>C(p,5)=1;<br>C(p,:)=1;</pre><p>And here are some illegal cases:</p><pre>C(p,a)=1;   % a is some random variable<br>C(p,p)=1;<br>C(p,1:a)=1;<br>C(p,1:p)=1;</pre><p>So as you can see, to compute a matrix using parallel computation, MATLAB requires you to compute it by a whole row/column or just a constant cell.</p><p>This sounds easy, but in many cases, it requires us to transform our representation or even conceptualization of the problem.</p><p>In my case, I partition my (A*A)*(I*I) matrix C into A*I blocks and compute these blocks one by one using two nested for loop. However, I cannot do this in the new parfoor loop since we need to fill out the matrix with a whole row. I had a really hard time conceptualizing the process in the beginning because I think of my matrix blocks instead of rows or columns. Now that we need to partition the matrix by row, everything looks so different now and I am not sure how to conceptualize such process.</p><p>I eventually solve this problem by drawing out the whole matrix and it is actually quiet simple. But I learn a lot from this process.</p><h4>Why parallel computing is fun? (And what I learn?)</h4><p>Since parallel computing is doing the computation in parallel manner, it requires a different mindset compared to sequential computing.</p><p>The first thing is how we organized our data structure. If we are using parallel toolbox/library, many of them require us to slice our variable in a column/row manner to fit their implementation, just like in MATLAB. To deal with this, we might need to tweak the data structure in our algorithm and some times that can be counter intuitive.</p><p>Let’s look at a matrix in Dijkstra Algorithm:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/210/1*2jRCHqAbTCY7W7oG5ntMOQ.gif" /></figure><p>As we can see, we are growing the matrix from bottom left to top right and parallel computing can actually be utilize to compute each element in diagonal layer. In that case, we will need to map our original matrix into a different matrix so that we can slice diagonal layer into column/row. Such matrix can be in weird shape and hard to conceptualize.</p><p>Moreover, we need to be extra careful about racing condition. In my case, the computation is just static mapping and values in C does not involve in the computing process, so it is safe to run the computation in whatever order the system wants. But in many other cases, this is not true and we might need extra instructions to implement the synchronization.</p><p>This sounds complicated, but with all the toolboxes out there, we are able to build parallel computing solution in a couple of hours and the improvement is amazing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*fLtPrwgCZVbiGNVx.png" /></figure><p>For me, MATLAB first start pooling “workers” for parallel computing works and this takes some time. Once the pooling is done in the first round, it only takes 0.2 seconds to finish a round of edges compatibility computing, while the same process takes 84 seconds without parallel computing. So I literally jumped out of my bed when it actually works!</p><p>And yep, I code on my bed too. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de0518542aac" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thoughts-and-notes/ml-my-first-with-parallel-computing-de0518542aac">My First with Parallel Computing</a> was originally published in <a href="https://medium.com/thoughts-and-notes">Thoughts and Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Parse for Android Development and the Increasing Layers of Abstraction]]></title>
            <link>https://medium.com/thoughts-and-notes/parse-for-android-development-and-the-increasing-layers-of-abstraction-6d4508be374c?source=rss----2939c491f2d7---4</link>
            <guid isPermaLink="false">https://medium.com/p/6d4508be374c</guid>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[parse]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Wesley Wei Qian]]></dc:creator>
            <pubDate>Tue, 22 Dec 2015 17:12:50 GMT</pubDate>
            <atom:updated>2016-02-04T18:29:13.016Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Update: Parse is shutting down</em></p><p><a href="http://blog.parse.com/announcements/moving-on/"><em>http://blog.parse.com/announcements/moving-on/</em></a></p><h4>Intro</h4><p>Building backend server and database can be a lot of work in the old day. Even with package like Node.js, build up API for database can be unpleasant. Moreover, for mobile application, “back threading” the internet calls and manage them in weak signal condition can be pains in the ass.</p><p>However, in the past month, I have built two Android applications with server database and server calls handled properly. These are made possible by a service called Parse.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tP7u9rJcxJNV80JD.png" /></figure><p>Parse is a backend service developed by Facebook for Android/iOS/Web developer to build their database, monitor service status and “cloud” their code.</p><h4>Parse with Android Development</h4><p>With the documentation on Parse, it is very easy get started with the Parse backend and the SDK is well documented so it is very handy and I am not going to go over it here. However, I do want to high highlight some useful features:</p><p><strong>Query Adapter</strong></p><p>In android development, if you have a list of items want to display, for instance a list of contacts information, you can use something called adapter where you can bind your data to the UI element</p><p>Traditionally, what I would have done is make a server call to get the data I want to display and then bind the data to the view in the adapter. This will involve building my own adapter and manage all the server call.</p><p>However, in the Parse SDK, there is something called Query Adapter where you can simply create a server database query and make a query adapter out of it so that you don’t need to worry about managing the server calls. If you want to customize the binding activity, you can simply extend this query adapter and do whatever you want with the data.</p><p><strong>Parse Image View</strong></p><p>If you want to display an image in our Android application, we can create an image view and bind an image to this view. If the image is on the server, we will need to download if from the server. Since image can be very large sometime, we will want to do the download in the back thread. However, since the image view binding is happening in the main thread, things get tricky very quickly.</p><p>To help with that, Parse SDK has its own Image View where you can simply cast a normal Image View to parse Image View and bind your image query on this view. Then it will help you load the image in background and display it on the image view without dragging down your main thread activity.</p><h4>Why Parse?</h4><p>I think Parse is amazing because it helps developer, especially for start up, to focus more on building the application itself instead of spending a lot of time to build or manage their own database.</p><p>Moreover, it is very easy to use since the Parse SDK introduce not just basic RESTful service but also some handy classes like Parse Image View and Parse Query Adapter which makes it super easy for us to integrate it with Android Development environment.</p><h4>The Idea of Abstraction</h4><p>As a kind of abstraction, Parse packages the whole backend “dirty” work and presents us a very clean and easy to use SDK. Therefore, without any knowledge in building database and server, a developer can have a backend for his/her application.</p><p>In some sense, abstraction is the most important concept in computer science. Will first came up representation to abstract data, then we came up programming language that can abstract the computing process, after which we abstract a sequence of operation and call them functions, which we can operate again and again.</p><p>So we love abstraction and that’s why will come up object oriented programming where we can represent data and function in a very clean manner so that user does not need to know what is in the package.</p><p>Following these ideas, we now have service like Parse and tons of API that help us create things that we actually know very little about. This allows us to build products and create features in a very effective way. Standing on giant’s shoulder, we don’t need to recreate the wheel anymore.</p><p>It is very cool, but maybe a little scary?</p><h4>The “Problem”</h4><p>Today, many people are worried about the increasing layers of abstraction in computer science might train a new generation of computer scientist that has very little knowledge of the fundamental mechanism of computer.</p><p>With Parse, students might be able to graduate with a CS degree without any database/server knowledge. Maybe in a very near feature, with more extra layers of abstraction, CS graduates might not need to know how to write code (people can already make games by dragging/linking modules without any coding).</p><p>This sounds pretty mess up, but I think it comes with the nature of computer science, its nature of abstraction. Computer science is very much about problem solving and once you know how to solve the problem, you can use whatever tools you like. The increasing layers of abstraction is giving us better tools to solve problem but to come up with the solution has never change.</p><p>So I probably will still take a database course and a network course, but I will keep using Parse without feeling guilty about not knowing what’s going on underneath.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d4508be374c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thoughts-and-notes/parse-for-android-development-and-the-increasing-layers-of-abstraction-6d4508be374c">Parse for Android Development and the Increasing Layers of Abstraction</a> was originally published in <a href="https://medium.com/thoughts-and-notes">Thoughts and Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning and Human Learning]]></title>
            <link>https://medium.com/thoughts-and-notes/machine-learning-and-human-learning-577530aee0b5?source=rss----2939c491f2d7---4</link>
            <guid isPermaLink="false">https://medium.com/p/577530aee0b5</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[cognitive-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Wesley Wei Qian]]></dc:creator>
            <pubDate>Tue, 22 Dec 2015 17:12:32 GMT</pubDate>
            <atom:updated>2015-12-09T20:10:40.729Z</atom:updated>
            <content:encoded><![CDATA[<p>What if we train machine learning models just like training babies?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*GnI-ctn3AHOuGZDo.jpg" /></figure><h4>Intro</h4><p>I read <a href="http://zhi.hu/o889">an interesting comment</a> today about the “notorious” over fitting problem in machine learning and the author describes an “over fitted” model as a student who try too hard to learn from the presented learning material and start to believe in some materials that are not necessarily true.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/0*Vz7wyvfwaJlDG9Sm.png" /></figure><p>I found this comment particularly interesting. Not just because it is funny, but also because it reveals a fundamental relationship between machine learning and human learning. For too long, we have been thinking about machine learning model as a statistical model, but thinking of training model as training students can be very helpful. And I think that is partially why “Deep Learning”, the recent head-line machine learning technique, can be so successful.</p><h4>In Deep Learning</h4><p>As we know more and more about cognitive science, people start to develop cognitive system in machine and “Deep Learning” is a great example. To perceive information from sensors, human brain has a sequence of specific -&gt; general layers where separated signals are received in the first layer and being generalized and understood in the later layer.</p><p>For example, a combination of photon receptors gives us a shape of green tree and then memory system helps us remember this shape is “a tree”. Similarly, in deep learning, information, like images, are broken down and recombined in higher dimension before being learned. However, I don’t think “Deep Learning” is the only reflect of human’s learning/cognitive process.</p><h4>In Older Machine Learning</h4><p>Even though in older machine learning field, building model is more of a statistical process, they are still very well related to human learning process.</p><p><strong>Work Harder on Your Weak Spot</strong></p><p>When I was still in high school, we were ranked by our total score of Chinese, Math, English, Physics, Chemistry and Biology. I seldom made the top 10 because I am not very good at Chinese and Biology. Therefore, I spend more time on Chinese and Biology. Work harder on your weak subject, that’s what they call.</p><p>The same spirit is actually borrowed by a machine learning method called AdaBoost, where a number of models is being trained and at each training iteration, the sample that is not correctly predicted will be given more weight so that the model will learn from this sample harder during the next iteration. So yes, the model needs to work harder on their weak sample/feature too.</p><p><strong>Don’t be the Frog that Lived in the Shallow Well</strong></p><p>When I was very little, my parents liked to travel with me so that I can see more and hopefully understand more. They also encouraged me to experience different things because they believe to be creative, you have to see more and understand how huge this world can be. That famous frog from Aesop’s Fables thinks the sky is just a blue circle because he hasn’t seen much.</p><p>In machine learning, seeing more means more sample data. To train a good model, we emphasize on collecting data and there is a even motto call “Who owns the data, who is the king.” in the field. Only with enough training sample, a model can be robust enough. If the machine only has learned imagines of Caucasian and gorilla, of course it will label African Americans as gorilla (Joke is on you, Google!). So yes, you don’t want your machine learning model to be the frog that lived in that shallow well.</p><p><strong>Don’t memorize the practice exam (or you are over fitted)</strong></p><p>I love professors who are willing to prepare practice exams even though memorizing every single questions in the practice exam will NOT get you anywhere. I think a good approach for studying practice exam is just getting a basic understanding of what will be in the exam and how hard the exam will be. Moreover, I would like to get a feel on how the professor will test on a specific topic, and what will be the best approach for questions on this kind of topic. So, instead of learning the detail of the practice exam, grepping a general idea from the practice exam can be more helpful.</p><p>If we think of the training sample in machine learning just as practice exam, and doing sample exam as training a model, the same spirit applies too. If the machine just memorizes every single questions (data point) from the practice exam (training data set), it will be over fitting the training data set (just like the over fitting sample above!). Even though the model score 100 points in its sample exam, memorizing every single exam will probably not able to help it pass the actual test (test sample). Instead, if the model can make a good generalization of the training sample, it probably can make a 80% during the actual test even though it can’t really tell the specific answer for those practice questions.</p><h4>Conclusion</h4><p>The cliché study strategy list can go on and on, but the idea behind these examples is really about relating machine learning idea with human learning strategy and maybe next time, when you are training a model, think of it as training a student. What will you do?</p><p>Many good machine learning researchers tend to be very good mentors and I wonder if this idea has anything to do with that. ;P</p><p><strong>Disclaimer: I don’t have a Ph.D in machine learning or cognitive science, so don’t take my words for granted</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=577530aee0b5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thoughts-and-notes/machine-learning-and-human-learning-577530aee0b5">Machine Learning and Human Learning</a> was originally published in <a href="https://medium.com/thoughts-and-notes">Thoughts and Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What We Learn from the Cardinality of Infinity?]]></title>
            <link>https://medium.com/thoughts-and-notes/math-what-we-learn-from-the-cardinality-of-infinity-be21b9881085?source=rss----2939c491f2d7---4</link>
            <guid isPermaLink="false">https://medium.com/p/be21b9881085</guid>
            <category><![CDATA[the-fault-in-our-stars]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[infinity]]></category>
            <dc:creator><![CDATA[Wesley Wei Qian]]></dc:creator>
            <pubDate>Tue, 22 Dec 2015 17:12:16 GMT</pubDate>
            <atom:updated>2015-12-09T20:11:43.495Z</atom:updated>
            <content:encoded><![CDATA[<p>I took a math proof class last semester and we spend a huge chunk of time talking about cardinality, especially the cardinality of infinity, which is a rather new topic in the discussion of cardinality. Even though the proof is a lack of excitement for me, the idea of comparing uncountable and infinity is very beautiful and philosophical. But I didn’t think further.</p><p>Infinity is mysterious yet beautiful and that’s probably why people seem to like the infinity symbol very much for the representation of love. People always want more.</p><p>So I watched a very moving love story today called “The Fault in Our Stars”. It is about the love between two dying people. The play writing is amazing and the screen shoot is also very good. But what I found enlighten is a very short quote from an interesting book writer: “Some infinities are bigger than other infinities.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/0*aM4w7OLl9wvrJaET.png" /></figure><p>My first reaction upon this line is go back to the math and confirms it is true. Then I realized how philosophical this problem can be. In the movie, the girl always wanted more days with the boy, always, eternally, forever. This are all infinity. Because we wanted infinity. But is there a smaller infinity?</p><p>Let’s switch unit from day to seconds, a day in seconds, in milliseconds can also be infinity. Maybe if we can switch the way we look at infinity, looking for a smaller set of infinity, we can realized how valuable are life, our work and our relationship can be.</p><p>Just like the story in the movie, the boy wanted to be loved by everybody, but then realized that love from a simple individual can also be infinity.</p><p>I tag this title with Math is because I like Math, but more importantly, I think there are always some good points behind the dry statement from a science book.</p><p>Lastly I hope you can appreciate this eulogy the girl wrote for the boy:</p><p>“There are infinite numbers between 0 and 1. There’s .1 and .12 and .112 and an infinite collection of others. Of course, there is a bigger infinite set of numbers between 0 and 2, or between 0 and a million. Some infinities are bigger than other infinities. A writer we used to like taught us that. There are days, many of them, when I resent the size of my unbounded set. I want more numbers than I’m likely to get, and God, I want more numbers for Augustus Waters than he got. But, Gus, my love, I cannot tell you how thankful I am for our little infinity. I wouldn’t trade it for the world. You gave me a forever within the numbered days, and I’m grateful.”</p><p><em>Originally published at </em><a href="http://www.wesleyq.me/blog/what%20we%20learn%20from%20the%20cardinality%20of%20infinity/"><em>www.wesleyq.me</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=be21b9881085" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thoughts-and-notes/math-what-we-learn-from-the-cardinality-of-infinity-be21b9881085">What We Learn from the Cardinality of Infinity?</a> was originally published in <a href="https://medium.com/thoughts-and-notes">Thoughts and Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build a Personal Website Using Jekyll Blog Framework]]></title>
            <link>https://medium.com/thoughts-and-notes/tool-build-a-personal-website-using-jekyll-blog-framework-7fd49c43be42?source=rss----2939c491f2d7---4</link>
            <guid isPermaLink="false">https://medium.com/p/7fd49c43be42</guid>
            <category><![CDATA[jekyll]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Wesley Wei Qian]]></dc:creator>
            <pubDate>Tue, 22 Dec 2015 17:11:58 GMT</pubDate>
            <atom:updated>2015-12-09T20:11:26.708Z</atom:updated>
            <content:encoded><![CDATA[<p>I was wandering at Github last night at around eight and I saw Kahlil forked a project called <a href="https://github.com/barryclark/jekyll-now">Jekyll-now</a>. I clicked in it out of curiosity and 12 hours later, this is what I got.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s-6XCwVjE3FFo4QtibSNBA.png" /><figcaption>www.wesleyq.me</figcaption></figure><p>It is originally designed to create blog site, but with some creativity, we can make it a personal website ;P</p><h4>I. So what is Jekyll?</h4><blockquote><em>Jekyll is an open source program, written in Ruby by Tom Preston-Werner, GitHub’s co-founder. Jekyll is a simple, blog-aware, static site generator for personal, project, or organization sites. Instead of using databases, Jekyll takes the content, renders Markdown or Textile and Liquid templates, and produces a complete, static website ready to be served by Apache HTTP Server, Nginx or another web server. Jekyll is the engine behind GitHub Pages, a GitHub feature that allows users to host websites based on their GitHub repositories. We loved with a love that was more than love</em></blockquote><p>Basically, Jekyll is a static webpage server. But a very special one:</p><ul><li>It is not a traditional HTML/CSS/JavaScript framework as your data is not populated by direct JavaScript command. Instead, your data is stored in a Markdown file with simple tag and then you use Liquid templates to populate the content in the Markdown files. Without a database, a ordinary blogger can update his/her blog by simply adding a new markdown file without worrying the code.</li><li>Since Jekyll is supported by Github repo, you don’t need to get a dedicated server for your personal page. Instead, you can simply use github.io to serve your jekyll sites.</li></ul><p>And the Jekyll-now I mentioned above is a even simpler version of Jekyll that already have a blog layout and all you need to do is changing web title and adding markdown files.</p><h4>II. Install Jekyll</h4><p>If you are running Mac OSX, where Ruby should be already installed, you can simply run</p><pre>gem install jekyll</pre><p>in your Terminal and Jekyll will be installed automatically.</p><h4>III. Start with a Template</h4><p>Just to get started without worrying too much about css/javascript, you can go to some of the template website to get started with a beautiful template. The one I use comes from <a href="http://startbootstrap.com/template-overviews/landing-page/">Start Bootstrp</a>. I love this site because their template are all built with Bootstrap, so it is very easy to add animation effect/navigation bar/responsive layout, etc.</p><p>From here, you can choose to download the Jekyll version of the template. After you unzip the file, navigate into the folder storing all the template files in Terminal.</p><p>If you successfully install jekyll, you should be able to run</p><pre>jekyll serve</pre><p>in Terminal and it will compile our jekyll project into a _site folder and serve our website through this folder). Go to this address <a href="http://127.0.0.1:4000/">http://127.0.0.1:4000/</a> in your browser and you should be able to see the starting Template.</p><h4>IV. Personalize</h4><p><strong>Basic Config</strong></p><p>First, you can start personalize the website by changing the title/ subtitle/ author/ social info by overwriting the _config.yml and index.html, where this information are stored.</p><p><strong>Understand the layout</strong></p><p>Then you can go into the _layouts folder and opens up the default.html file.</p><pre>&lt;!--liquid signs are removed for parsing--&gt;<br>    &lt;body&gt;<br>        include header.html<br>        include about.html<br>        include page_content.html<br>        include contact.html<br>        include footer.html<br>        include js.html<br>    &lt;/body&gt;</pre><p>In the body segment, you can find out how the webpage is composed. You have a header file represents the banner and the open image. An about file introduce yourself, a contact file creates the contact banner in the end, and a footer file with the website information. The js file is for all the javscript you are inserting for the website. If you are not please with any of the components, you can just go to these files (located in the _includes folder) and change them directly.</p><p>If you want to add some components, for our purposes, a page content for experiences, a page content for projects and a page content for education record, you can create different page_content html file in the _includes folder and add/reorder them here in the default.html.</p><p><strong>Populate Contents</strong></p><p>But there is one thing we haven’t talked about, is the page <em>content file. This file is the main file that will interact and populate your markdown files in the _post folder. Even though there is only one page</em>content file, it can populate all the markdown files in the _posts folder using a Liquid Template:</p><pre>&lt;section id=&quot;services&quot;&gt;<br>&lt;!-- Page Content --&gt;<br>&lt;!--liquid signs are removed for parsing--&gt;<br>for post in site.posts reversed<br>  capture thecycle | cycle &#39;odd&#39;, &#39;even&#39; | endcapture<br>     if thecycle == &#39;odd&#39;</pre><p>In the header of this page_content file, we can see there is a for loop, which will represent each file as post and go through each of our files in the _post folder and generate a html section for each of them.</p><p>In our case, there is also a thecycle variable which will help up create differnt layout for odd number post or even number post.</p><p>And then let’s look at one of the markdown file that we are posting</p><pre>---<br>layout: default<br>img: ipad.png<br>category: Services<br>title: Death to the Stock Photo:&lt;br&gt;Special Thanks<br>description: |<br>---<br>  A special thanks to [Death to the Stock Photo](http://join.deathtothestockphoto.com/) for providing the photographs that you see in this template.  Visit their website to become a member!</pre><p>in the lines between the dash, we can see there are some properties are defined. For example, which category this posts belonged (experiences, projects, educations?), what images are associated with it, what title is it, etc.</p><p>But how do we access this information? Let’s look at the HTML file,</p><pre>&lt;div class=&quot;col-lg-5 col-sm-6&quot;&gt;<br>    &lt;hr class=&quot;section-heading-spacer&quot;&gt;<br>    &lt;div class=&quot;clearfix&quot;&gt;&lt;/div&gt;<br>    &lt;h2 class=&quot;section-heading&quot;&gt;&lt;/h2&gt;<br>    &lt;div class=&quot;lead&quot;&gt;&lt;/div&gt;<br>&lt;/div&gt;<br>&lt;div class=&quot;col-lg-5 col-lg-offset-2 col-sm-6&quot;&gt;<br>    &lt;img class=&quot;img-responsive&quot; src=&quot;img/services/&quot; alt=&quot;&quot;&gt;<br>&lt;/div&gt;</pre><p>as we can see, we can access the content (anything below the dash) and the file properties by simply calling `` and we can then cooperate our content with our html/css layout, and to access the image, we just go to the img/services folder and find the image with the right name associated with the post.</p><p>One minor thing on the markdown file, since Jekyll is designed to populate blogs instead of personal info, its markdown file names has to format like YEAR-MONTH-DAY-FILENAME, so if you will still need to meet to format even though your markdown file is your resume content instead of blogs.</p><h4>V. Go Public</h4><p>Once you finish testing your personal webpage at local, you can public your site through Github.</p><p>You first go to your github account and create a github repo called</p><p>USERNAME.github.io</p><p>and then you can push all your contents to this repo and your website should be live at USERNAME.github.io a couple minutes later.</p><p>P.S. For those of you does not have any experience with Github, please check out this link: <a href="http://lifehacker.com/5983680/how-the-heck-do-i-use-github">http://lifehacker.com/5983680/how-the-heck-do-i-use-github</a>.</p><h4>VI. Conclusion</h4><p>In general, I think the Jekyll framework is very easy, so if you have some experience with web design, it should just be a piece of cake and what makes it amazing is that you just need add a markdown file to update your site. However, since the site is static, it is hard to use it to do interaction with user. So if you just want to simple way to present something, especially things that should populated in a similar way, Jekyll is definitely your way to go.</p><p>Writing tutorial is harder than I thought and I should do a better job in explaining things. Let me know if you have any further questions or find any mistakes in the post.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fd49c43be42" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thoughts-and-notes/tool-build-a-personal-website-using-jekyll-blog-framework-7fd49c43be42">Build a Personal Website Using Jekyll Blog Framework</a> was originally published in <a href="https://medium.com/thoughts-and-notes">Thoughts and Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Intelligent Machine]]></title>
            <link>https://medium.com/thoughts-and-notes/the-intelligent-machine-1d35ad343237?source=rss----2939c491f2d7---4</link>
            <guid isPermaLink="false">https://medium.com/p/1d35ad343237</guid>
            <category><![CDATA[escher]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Wesley Wei Qian]]></dc:creator>
            <pubDate>Tue, 22 Dec 2015 17:11:42 GMT</pubDate>
            <atom:updated>2015-12-09T20:06:50.991Z</atom:updated>
            <content:encoded><![CDATA[<p>I have watched a lot of AI theme movie/series lately and some interesting questions are raised. For example, can we really achieve a real AI? or what is an AI? I am not sure, and that’s why AI is so interesting. While it is very technical, it is also very philosophical.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*dwujyRCiQZcZMtaFlxfT6g.jpeg" /><figcaption><a href="http://www.mcescher.com/">M.C. Escher</a></figcaption></figure><p>In the current literature, most of the AI is weak AI depends on conditioning and a set of rules. Even in machine learning, the model is designed to handle the condition value automatically with a prefix structure. In the end of the day, AI in current stage cannot do something that it is not designed to do, in other words, they cannot develop themselves into other domain.</p><p>So people might wonder, why don’t we just look at human’s brain and see how that works? But human brain is a very complicated conditioning system, which I would think of as a chaotic system, and such system is very hard to trace, generalized and understand.</p><p>What if human’s thoughts are just like program, the way we design AI right now? Can human understand the human program itself? Similarly, can a program understand itself, what it does and how it does it — some self aware. Can we write such function?</p><p>If not, can human really understand their cognitive process/program and transplant it to machine? Or, do we really need to copy human brain? Is there other kinds of intelligence? Or do we really need the true intelligence, or we just need a intelligent machine working like a personal secretary?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d35ad343237" width="1" height="1" alt=""><hr><p><a href="https://medium.com/thoughts-and-notes/the-intelligent-machine-1d35ad343237">The Intelligent Machine</a> was originally published in <a href="https://medium.com/thoughts-and-notes">Thoughts and Notes</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>