Skip to content

Commit

Permalink
changed input name from initialSeed to seed for BO sampler
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielSoto-INL committed Apr 11, 2024
1 parent 05fbc29 commit 26ffb38
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
7 changes: 2 additions & 5 deletions src/Cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,8 +546,8 @@ def _specs_optimizer(cls):
bayesian_opt.addSub(acquisitionSub)

#======== Kernel for BO========#
seedSub = InputData.parameterInputFactory('initialSeed', contentType=InputTypes.IntegerType,
descr=r"""The initial seed for random number generator used
seedSub = InputData.parameterInputFactory('seed', contentType=InputTypes.IntegerType,
descr=r"""The seed for random number generator used
for sampling the model within the Bayesian Optimizer.""",
default='RAVEN-determined')
bayesian_opt.addSub(seedSub)
Expand Down Expand Up @@ -593,9 +593,6 @@ def _specs_optimizer(cls):
and number of trajectories for Gradient Descent.""")
optimizer.addSub(initialCountSub)


# optimizer.addSub(modelSelection)

#== Convergence Sub Node ==#
convergence = InputData.parameterInputFactory('convergence',
descr=r"""defines the optimization convergence criteria.""")
Expand Down
4 changes: 2 additions & 2 deletions templates/template_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,8 +761,8 @@ def _modify_outer_optimizers(self, template, case):
model_node.find('Duration').text = str(model_settings['duration'])
model_node.find('Method').text = model_settings['method']
# setting initial seed if requested
if BOsettings and 'initialSeed' in BOsettings.keys():
seed_node = xmlUtils.newNode('initialSeed', text=BOsettings['initialSeed'])
if BOsettings and 'seed' in BOsettings.keys():
seed_node = xmlUtils.newNode('initialSeed', text=BOsettings['seed'])
opt_node.find(".//samplerInit").append(seed_node)
elif strategy == 'GradientDescent':
GDsettings = optimization_settings['algorithm'][strategy]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<algorithm>
<BayesianOpt>
<acquisition>LowerConfidenceBound</acquisition>
<initialSeed>180</initialSeed>
<seed>180</seed>
</BayesianOpt>
</algorithm>
<opt_metric>NPV</opt_metric>
Expand Down

0 comments on commit 26ffb38

Please sign in to comment.