Implemented options to hotstart training #499
Open
+81
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR implements an option to provide the swarm position, velocity and global best (or any particle) to the optimizer. This was performed by adding the following optional arguments to the optimizer class:
init_vel
init_best
The arguments were added to
GlobalBestPSO
,GeneralOptimizerPSO
andLocalBestPSO
as well as to the abstract base classesSwarmOptimizer
andDiscreteSwarmOptimizer
.The optimizer can now be called as follows:
Related Issue
Motivation and Context
The current implementation does not allow to properly resume a previous optimization process. This PR makes it possible while maintaining full compatibility with previous versions.
How Has This Been Tested?
This has been tested in a limited manner so far. Only using
GlobalBestPSO
on Ubuntu 18.04, python 3.6.Screenshots (if appropriate):
Types of changes
Checklist: