File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 88        return  nothing 
99    end 
1010
11+     @model  logp_check () =  x ~  Normal ()
12+ 
1113    n_samples =  1000 
12-     model      =  demo ()
14+     model =  demo ()
1315
1416    @testset  for  sampler in  [
1517        RandPermGibbs (Slice (1 )),
3032        )
3133
3234        chain =  sample (model, externalsampler (sampler), n_samples; progress= false )
35+ 
36+         chain_logp_check =  sample (
37+             logp_check (), externalsampler (sampler), 100 ; progress= false 
38+         )
39+         @test  isapprox (logpdf .(Normal (), chain_logp_check[:x ]), chain_logp_check[:logp ])
3340    end 
3441
3542    @testset  " gibbs($sampler )" for  sampler in  [
4653            n_samples;
4754            progress= false ,
4855        )
56+ 
57+         chain_logp_check =  sample (
58+             logp_check (), Turing. Gibbs (:x  =>  externalsampler (sampler)), 100 ; progress= false 
59+         )
60+         @test  isapprox (logpdf .(Normal (), chain_logp_check[:x ]), chain_logp_check[:logp ])
4961    end 
5062end 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments