unique queues on each call for search
@@ -14,15 +14,11 @@ class Search(TracePosterior):
"""
New Trace and Poutine-based implementation of systematic search
"""
- def __init__(self, model, queue=None, max_tries=1e6):
+ def __init__(self, model, max_tries=1e6):
"""
Constructor
"""
self.model = model
- # XXX add queue here or on call to _traces?
- if queue is None:
- queue = Queue()
- self.queue = queue
self.max_tries = int(max_tries)
def _traces(self, *args, **kwargs):
@@ -32,7 +28,7 @@ class Search(TracePosterior):
Running until the queue is empty and collecting the marginal histogram
is performing exact inference
"""
- if self.queue.empty():
+ self.queue = Queue()
self.queue.put(poutine.Trace())
p = poutine.trace(
