added binary denoising notebook

http://nbviewer.ipython.org/gist/Jiaolong/c971175818df85f2c181
Yeah, you are right! Pairwise parameters are shared, so theta_p(yi,yj) *
phi_ij, isn't it? Because phi is factor type tied.


On Sun, Aug 24, 2014 at 4:17 AM, Jiaolong <notifications@github.com> wrote:

> In doc/ipython-notebooks/structure/Binary_Denoising.ipynb:
>
> > +      "\n",
> > +      "Given a noise black/withe image $\\textbf{x}$ of size $m \\times n$, the task of denoising is to predicted the original binary image $\\textbf{y}$. We flatten the image into a long vector $\\textbf{y} = [y_0, \\dots, y_{m\\times n}]$, where $y_i \\in \\{0, 1\\}$ is the value for pixel $i$. In this work, we aim to learn a model from a bunch of noise input images and their ground truth binary images, i.e., supervised learning. One may think about learning a binary classifier for each pixel. It has several drawbacks. First, we may not care about classifying every single pixel completely correct, i.e., if we misclassify a single pixel, this is not as bad as misclassify a whole image. Second, we lose all context, e.g., pairwise pixels (one pixel and its neighbore). The structured predition here is to predict an entire binary image $\\textbf{y}$ or a grid graph of $m \\times n$. Here, the output space $\\mathcal{Y}$ is all possible binary images of size $m \\times
>   n$. It
>  can be formulated as following:\n",
> > +      "\n",
> > +      "$$\n",
> > +      "\\hat{\\textbf{y}} = \\underset{\\textbf{y} \\in \\mathcal{Y}}{\\operatorname{argmax}} f(\\textbf{x},\\textbf{y}),    (1)\n",
> > +      "$$\n",
> > +      "\n",
> > +      "where $f(\\textbf{x},\\textbf{y})$ is the compitibility function, measures how well $\\textbf{y}$ fits $\\textbf{x}$. There are basically three challenges in doing structured learning and prediction:\n",
> > +      "- Choosing a parametric form of $f(\\textbf{x},\\textbf{y})$\n",
> > +      "- solving $\\underset{\\textbf{y} \\in \\mathcal{Y}}{\\operatorname{argmax}} f(\\textbf{x},\\textbf{y})$\n",
> > +      "- learning parameters for $f(\\textbf{x},\\textbf{y})$ to minimize a loss\n",
> > +      "\n",
> > +      "In this work, our parameters are pairwise and unary potentials and they can be written as:\n",
> > +      "\n",
> > +      "$$\n",
> > +      "f(\\textbf{x},\\textbf{y}) = \\sum_i \\theta_u \\phi_u(\\textbf{x},y_i) + \\theta_p\\phi_p(\\textbf{x}, y_i, y_j),    (2)\n",
>
> In fact, since we use fixed size of images, we can define full-connected
> factor graph model and use different parameters for different pairwise
> factors, but it will make the computation very slow.
>
> I have tried it for 10x10 images, and it works very well but for images
> larger than 20x20, it is extremely slow.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/shogun-toolbox/shogun/pull/2467/files#r16635443>.
>



-- 
/**
* ============HuShell============
*/