-
8000
Notifications
You must be signed in to change notification settings - Fork 28
Grid search #386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grid search #386
Conversation
I see how the error is happening -- the ci/cd server seems to be trying to compile all .py files, including the one you are using as a template for the encoder. Perhaps changing the suffix from .py to something like .template would work. |
I am also shocked that 54 files have changed -- but most of these seem to be whitespace changes. It would be better for me as a reviewer if such reformatting occurred in a separate pull request. |
tests/test_grid_sampler.py
Outdated
params["x2"] = {"type": "boolean", "default": True} | ||
|
||
# python file is its own template | ||
encoder = uq.encoders.GenericEncoder('tests/grid_search/test_grid.py', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps change the name to 'tests/grid_search/test_grid.template' so that the invalid program 'tests/grid_search/test_grid.py' is not checked by the CI/CD system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, I didn't know it would try to complile these. Will change to .template indeed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And sorry for the 54 files, shouldn't have done the pep8 fixes
tests/grid_search/test_grid.py
Outdated
@@ -0,0 +1,14 @@ | |||
#!/usr/bin/python3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest renaming this file to 'tests/grid_search/test_grid.template' so that the CI/CD tests don't fail when trying to see if the syntax is OK.
try: | ||
fabsim("fetch_results", "", machine) | ||
return True | ||
except: |
Check notice
Code scanning / CodeQL
Except block handles 'BaseException'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you should never use try..except like this (with no exception type specified)
#get the output lines of fab <machine> stat | ||
try: | ||
out = subprocess.run(['fabsim', machine, 'stat'], stdout=subprocess.PIPE) | ||
except: |
Check notice
Code scanning / CodeQL
Except block handles 'BaseException'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy except for the indicated changes so that the AFAB CI/CD tests run
Added a
Grid_sampler
to perform hyperparameter tuning for neural networks in parallel. New files:easyvvuq/sampling/grid_sampler.py
: the new sampler classtests/test_grid_sampler.py
: a test for the grid samplertutorials/hyperparameter_tuning_tutorial.ipynb
: a tutorial on using the GridSampler to tune the hyperparameters of a TensorFlow neural network for character recognition.tutorials/hyperparameter_tuning_tutorial_with_fabsim.ipynb
: same as above, only using FabSim3 to submit the ensemble.I tested it locally and on Archer2, using FabSim + QCG PilotJob.