File tree Expand file tree Collapse file tree
autofit/non_linear/search/nest/dynesty/search Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66from dynesty import NestedSampler as StaticSampler
77
88from autofit .database .sqlalchemy_ import sa
9+ from autofit import jax_wrapper
10+
911from autofit .mapper .prior_model .abstract import AbstractPriorModel
1012
1113from .abstract import AbstractDynesty , prior_transform
@@ -109,6 +111,8 @@ def search_internal_from(
109111 in the dynesty queue for samples.
110112 """
111113
114+ gradient = fitness .grad if self .use_gradient else None
115+
112116 if checkpoint_exists :
113117 search_internal = StaticSampler .restore (
114118 fname = self .checkpoint_file , pool = pool
@@ -127,7 +131,7 @@ def search_internal_from(
127131 self .write_uses_pool (uses_pool = True )
128132 return StaticSampler (
129133 loglikelihood = pool .loglike ,
130- gradient = fitness . grad ,
134+ gradient = gradient ,
131135 prior_transform = pool .prior_transform ,
132136 ndim = model .prior_count ,
133137 live_points = live_points ,
@@ -139,7 +143,7 @@ def search_internal_from(
139143 self .write_uses_pool (uses_pool = False )
140144 return StaticSampler (
141145 loglikelihood = fitness ,
142- gradient = fitness . grad ,
146+ gradient = gradient ,
143147 prior_transform = prior_transform ,
144148 ndim = model .prior_count ,
145149 logl_args = [model , fitness ],
You can’t perform that action at this time.
0 commit comments