-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Save parameters as a dictionary &
load_parameters
(#344)
* * Add `get_parameters` function (returns all loadable/saveable tensorflow Variables) * Add `load_parameters` function (loads model parameters from file/file-like/list of ndarrays) * Update A2C, ACER, ACKTR, DDPG, DQN, PPOs, SAC and TRPO to use `get_parameters` to define parameters necessary for correctly loading/saving models. * * Switch from using lists of parameters to dicts of variable name -> ndarray. * Includes support for loading from older .pkl files with a list of parameters * Renamed `get_parameters` to `_get_parameter_list` * `get_parameters` dictionary of variable name -> ndarrays * `_get_parameter_list` returns list of tensorflow Variables that should be saved/loaded * Updated changelog for changes * Clarified name of function parameter * Updated contributor's list * Fix few PEP8 errors * Update docs to reflect variable name * Fix PEP8/style in test_load_parameters * Requested small typo/doc changes and removed unused parameter in tests * Add parameter for with tests * Add tests for from a file/file-like objects * Use format-function and small line-length change * Add warning about not updating trainer parameters upon 'load_parameters' * Add an example of using load/get parameters with a simple ES example * Use OrderedDict for get_params rather than normal dict * Make _get_variable_list a public function * Update load_parameters example with A2C+ES hybrid and only mutating specific parameters
- Loading branch information
Showing
13 changed files
with
376 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.