Skip to content

Commit

Permalink
Update neurots/generate/section.py
Browse files Browse the repository at this point in the history
Co-authored-by: Adrien Berchet <[email protected]>
  • Loading branch information
arnaudon and adrien-berchet authored Sep 25, 2024
1 parent 3bffa0d commit 1f082b9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions neurots/generate/section.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ def prob(*args, **kwargs):
p *= constraint["section_prob"](*args, **kwargs)
return p

max_tries = DEFAULT_MAX_TRIES
randomness_increase = DEFAULT_RANDOMNESS_INCREASE
max_tries = -1
randomness_increase = -1
for constraint in self.context["constraints"]:
max_tries = max(
max_tries,
Expand All @@ -141,6 +141,10 @@ def prob(*args, **kwargs):
"randomness_increase", DEFAULT_RANDOMNESS_INCREASE
),
)
if max_tries < 0:
max_tries = DEFAULT_MAX_TRIES
if randomness_increase < 0:
randomness_increase = DEFAULT_RANDOMNESS_INCREASE

direction = accept_reject(
self._propose,
Expand Down

0 comments on commit 1f082b9

Please sign in to comment.