Implement assertions() in search methods
See original GitHub issueThanks to @SioKCronin , we’re now able to implement hyperparameter search tools such as GridSearch
and RandomSearch
. These are awesome implementations, but we can maximize its robustness by adding an assertions()
method in our classes. Would you like to try?
What you’ll do
Simply put, you will just add an assertions()
method in the SearchBase
class. This should contain various
checks when instantiating any class that inherits from it. You can check the docstrings for each class and create a proper method call for it.
If you want to check previous implementations, see the SwarmBase.assertions
method, and check how it is being implemented in GlobalBestPSO
(it is not called explicitly because it just inherits from the base) or in LocalBestPSO
(additional lines of code were added after calling the super()
because of extra attributes).
Go the extra mile?
If you want to go the extra mile, you can add tests to check for edge cases and see if your assertions are working when passed with an invalid input (maybe an invalid type, out-of-bounds, etc.). For this, you just need to add an Instantiation
class in the test.utils.search.test_gridsearch
and test.utils.search.test_randomsearch
modules.
Again, if you want a template, you can check the Instantiation
classes in test.optimizers.test_global_best
and others. Notice how we try to feed the class with invalid arguments/edge cases and have the unit test capture them. It’s a very fun activity!
If you wish to take this on, then feel free to drop a comment here! I’d be glad to help you!
Update: 9/17/2017
Follow the instructions in this quick-start guide to get you started!
Commit Guidelines
I’d appreciate if we lessen the number of commits per issue to 1-2. Of course you can commit often, but before merging, I would ask you to rebase them depending on the changes you’ve done. A commit format that we follow is shown below:
Short and sweet imperative title (#27)
Description of the commit. The commit title should be short
and concise, and must be in imperative form. It could be as
simple as `Add tests for optimizer` or `Implement foo`. It describes
the "what" of the commit. You must also reference the issue, if any,
in the title. Here, in the description, we explain the
"why" of the commit. This is more or less free-for-all. So you can
describe as detailed as possible, in whatever tense/form you like.
Author: <your-github-username>
Email: <your-email>
Issue Analytics
- State:
- Created 6 years ago
- Comments:32 (32 by maintainers)
Top GitHub Comments
@ljvmiranda921 Making good progress on #27. Just had to overcome a little nervousness 😃
Hi Lester @ljvmiranda921 ,
Great! I’ll finish up and check my work tomorrow morning!