File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " nuts-rs"
3- version = " 0.3 .0"
3+ version = " 0.4 .0"
44authors = [" Adrian Seyboldt <adrian.seyboldt@gmail.com>" ]
55edition = " 2021"
66license = " MIT"
Original file line number Diff line number Diff line change @@ -143,10 +143,14 @@ impl DrawGradCollector {
143143impl Collector for DrawGradCollector {
144144 type State = State ;
145145
146- fn register_draw ( & mut self , state : & Self :: State , _info : & crate :: nuts:: SampleInfo ) {
146+ fn register_draw ( & mut self , state : & Self :: State , info : & crate :: nuts:: SampleInfo ) {
147147 self . draw . copy_from_slice ( & state. q ) ;
148148 self . grad . copy_from_slice ( & state. grad ) ;
149149 let idx = state. index_in_trajectory ( ) ;
150- self . is_good = _info. divergence_info . is_none ( ) & ( idx != 0 ) ;
150+ if info. divergence_info . is_some ( ) {
151+ self . is_good = idx. abs ( ) > 4 ;
152+ } else {
153+ self . is_good = idx != 0 ;
154+ }
151155 }
152156}
You can’t perform that action at this time.
0 commit comments