From 657979d5253b22f8d372d40e1d5b0c494ac76b6a Mon Sep 17 00:00:00 2001 From: Gavin Mendel-Gleason Date: Fri, 10 Oct 2014 19:26:00 +0100 Subject: [PATCH 1/2] Small typo in the section describing setting of h_H. --- rbms/rbm_equations/rbm_template_gavin.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rbms/rbm_equations/rbm_template_gavin.ipynb b/rbms/rbm_equations/rbm_template_gavin.ipynb index 600a332..495a636 100644 --- a/rbms/rbm_equations/rbm_template_gavin.ipynb +++ b/rbms/rbm_equations/rbm_template_gavin.ipynb @@ -58,7 +58,7 @@ "\n", "$ = e^{\\mathbf{c}^T \\cdot \\mathbf{x}} / Z \\sum \\limits_{h_0 \\in \\{0,1\\}} ... \\sum \\limits_{h_H \\in \\{0,1\\}} \\prod\\limits_{j=1}^H \\exp{(h_j \\mathbf{W}_j \\cdot \\mathbf{x} + b_j h_j)}$\n", "\n", - "The $h_H$ value is now either $0$, in which case we get an exponential yeilding 1 times the remaining product and an expression depending on $h_H$ times the remaining product which we can then factorise the product back out of to obtain this:\n", + "The $h_H$ value is now either $0$, in which case we get an exponential yeilding 1 times the remaining product and an expression where $h_H=1$ times the remaining product which we can then factorise the product back out of to obtain this:\n", "\n", "$ = e^{\\mathbf{c}^T \\cdot \\mathbf{x}} / Z \\sum \\limits_{h_0 \\in \\{0,1\\}} ... \\sum \\limits_{h_{(H-1)} \\in \\{0,1\\}} \\prod\\limits_{j=1}^{H-1} \\exp{(h_j \\mathbf{W}_j \\cdot \\mathbf{x} + b_j h_j)}\\exp{(0)} + \\prod\\limits_{j=1}^{H-1} \\exp{(h_j \\mathbf{W}_j \\cdot \\mathbf{x} + b_j h_j)}\\exp{(\\mathbf{W}_H \\cdot \\mathbf{x} + b_H})$\n", "\n", From 5c2c663c251b26fbe84838281aadff4f81f32195 Mon Sep 17 00:00:00 2001 From: Gavin Mendel-Gleason Date: Fri, 10 Oct 2014 23:03:16 +0100 Subject: [PATCH 2/2] Wrong index, down to 1, not 0 --- rbms/rbm_equations/rbm_template_gavin.ipynb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/rbms/rbm_equations/rbm_template_gavin.ipynb b/rbms/rbm_equations/rbm_template_gavin.ipynb index 495a636..f1daa96 100644 --- a/rbms/rbm_equations/rbm_template_gavin.ipynb +++ b/rbms/rbm_equations/rbm_template_gavin.ipynb @@ -58,14 +58,15 @@ "\n", "$ = e^{\\mathbf{c}^T \\cdot \\mathbf{x}} / Z \\sum \\limits_{h_0 \\in \\{0,1\\}} ... \\sum \\limits_{h_H \\in \\{0,1\\}} \\prod\\limits_{j=1}^H \\exp{(h_j \\mathbf{W}_j \\cdot \\mathbf{x} + b_j h_j)}$\n", "\n", - "The $h_H$ value is now either $0$, in which case we get an exponential yeilding 1 times the remaining product and an expression where $h_H=1$ times the remaining product which we can then factorise the product back out of to obtain this:\n", + "The $h_H$ value is now either $0$, in which case we get an exponential yeilding 1 times the remaining product and an expression depending on $h_H$ times the remaining product which we can then factorise the product back out of to obtain this:\n", "\n", "$ = e^{\\mathbf{c}^T \\cdot \\mathbf{x}} / Z \\sum \\limits_{h_0 \\in \\{0,1\\}} ... \\sum \\limits_{h_{(H-1)} \\in \\{0,1\\}} \\prod\\limits_{j=1}^{H-1} \\exp{(h_j \\mathbf{W}_j \\cdot \\mathbf{x} + b_j h_j)}\\exp{(0)} + \\prod\\limits_{j=1}^{H-1} \\exp{(h_j \\mathbf{W}_j \\cdot \\mathbf{x} + b_j h_j)}\\exp{(\\mathbf{W}_H \\cdot \\mathbf{x} + b_H})$\n", "\n", "$ = e^{\\mathbf{c}^T \\cdot \\mathbf{x}} / Z \\sum \\limits_{h_0 \\in \\{0,1\\}} ... \\sum \\limits_{h_{(H-1)} \\in \\{0,1\\}} \\prod\\limits_{j=1}^{H-1} \\exp{(h_j \\mathbf{W}_j \\cdot \\mathbf{x} + b_j h_j)} (1 + \\exp{(\\mathbf{W}_H \\cdot \\mathbf{x} + b_H}))$\n", "\n", "\n", - "Repeat this trick for each sum from $H-1$ down to $0$.\n", + "Repeat this trick for each sum from $H-1$ down to $1\n", + "$.\n", "\n", "$ = e^{\\mathbf{c}^T \\cdot \\mathbf{x}} / Z \\times (1 + \\exp{(\\mathbf{W}_1 \\cdot \\mathbf{x} + b_1})) \\times ... \\times (1 + \\exp{(\\mathbf{W}_H \\cdot \\mathbf{x} + b_H}))$\n", "\n", @@ -84,7 +85,11 @@ "$ p(\\mathbf{h}|x) = \\prod_j p(h_j | x) $ \n", "\n", "$ p(h_j = 1 | x) = \\dfrac{1}{ 1 + e^{-(\\beta_j + W_j.x)} } $ \n", - "$ p(x|h) $\n" + "$ p(x|h) $\n", + "\n", + "$ \\sum\\limits_{i=1}^{N} 1 = 1 + 1 + ... + 1 $ ($N$ times)\n", + "\n", + "$ \\sum\\limits_{i=1}^{3} i = 1 + 2 + 3 = 6$" ] }, {