gibbs sampling and contrastive divergence

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

gibbs sampling and contrastive divergence

Ahmed Mazari
Hello,

l want to have 1000 configurations at the end of the process of gibbs sampling rather than one configuration. How can l do that properly

Thank you

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gibbs sampling and contrastive divergence

Michael Borregaard
What function are you using?

On Fri, Aug 19, 2016 at 4:23 PM, Ahmed Mazari <[hidden email]> wrote:
Hello,

l want to have 1000 configurations at the end of the process of gibbs sampling rather than one configuration. How can l do that properly

Thank you

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gibbs sampling and contrastive divergence

Ahmed Mazari
function gibbs(rbm::HTRBM,bp::BPTree,vis; n_times=1)
  v_pos
= vis
  h_pos
= sample_hid(rbm,bp,v_pos)


  v_neg
= sample_vis(rbm,hid)
  h_neg
= sample_hid(rbm,bp,v_neg)

 
for i=1:n_times-1
    v_neg
= sample_vis(rbm,h_neg)
    h_neg
= sample_hid(rbm,bp,v_neg)
 
end

 
return v_pos,h_pos,v_neg,h_neg
end

CD : contrastive divergence

function CD(rbm::HTRBM,bp::BPTree,vis; n_times=1)
  v_pos
= vis
 
  h_pos
,h_pos_cov,h_samples = get_hid(rbm,bp,v_pos)

 
# CD1
  v_neg
= sample_vis(rbm,h_samples)
 
  h_neg
,h_neg_cov,h_samples = get_hid(rbm,bp,v_neg)

 
# CDn
 
for i=1:n_times-1
    v_neg
= sample_vis(rbm,h_samples)
    h_neg
,h_neg_cov,h_samples = get_hid(rbm,v_neg)
 
end


 
return v_pos,h_pos,h_pos_cov,v_neg,h_neg,h_neg_cov
end



On Friday, August 19, 2016 at 4:30:50 PM UTC+2, Michael Borregaard wrote:
What function are you using?

On Fri, Aug 19, 2016 at 4:23 PM, Ahmed Mazari <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="WiQ_o2aLEAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ahmedma...@...> wrote:
Hello,

l want to have 1000 configurations at the end of the process of gibbs sampling rather than one configuration. How can l do that properly

Thank you

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="WiQ_o2aLEAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">julia-stats...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gibbs sampling and contrastive divergence

Ahmed Mazari
In reply to this post by Ahmed Mazari
i have another question related to the topic. When we would like to draw a histogram for our gibbs samplaing what should be the  axis of abscissa and Ordinate ?

On Friday, August 19, 2016 at 4:23:24 PM UTC+2, Ahmed Mazari wrote:
Hello,

l want to have 1000 configurations at the end of the process of gibbs sampling rather than one configuration. How can l do that properly

Thank you

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: gibbs sampling and contrastive divergence

Andrei Zh
l want to have 1000 configurations at the end of the process of gibbs sampling rather than one configuration.

So just take 1000 samples, i.e. run `gibbs(...)` 1000 times, preferably with different input data points (`vis` parameter).

Note that the idea of contrastive divergence is to reduce number of Gibbs sampling iterations per datapoint. Normally, only 1 pass is used (i.e. CD-1).
 
i have another question related to the topic. When we would like to draw a histogram for our gibbs samplaing what should be the  axis of abscissa and Ordinate ?

I think the question is what you are trying to achieve. Gibbs sampling is used to produce samples from a highly multivariate distribution, so visualizing it using histograms doesn't sound very reasonable. Can you give some context of your work and reference to a library/project you are using if it's available. 

 

On Friday, August 19, 2016 at 5:45:57 PM UTC+3, Ahmed Mazari wrote:
i have another question related to the topic. When we would like to draw a histogram for our gibbs samplaing what should be the  axis of abscissa and Ordinate ?

On Friday, August 19, 2016 at 4:23:24 PM UTC+2, Ahmed Mazari wrote:
Hello,

l want to have 1000 configurations at the end of the process of gibbs sampling rather than one configuration. How can l do that properly

Thank you

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Loading...