-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove `torch.tensor` in tensor conversion * Method `torch.tensor` always copies the data * Makes it slower than other tensor converion methods Use `from_numpy` for np to tensor conversion * Method `from_numpy` has lower overhead than `as_tensor` * Supply dtype for tensor conversions. Faster than calling tensor.float() Allow enabling of cudnn benchmarks for CNN * Enabled benchmarks optimize algorithm performance * Remove suppressed argument in CNNModule Use common functon to convert data to tensors * Modify `np_to_torch` to only perform type conversion when needed * Use it for all numpy to tensor conversions * Add common [object] to tensor function This optimizes conversion of data to tensors Add custom zero_grad optimizer function * This will allow setting of grads to None Resolve conversion of observations to tensors Set gradients to None in single-task RL algrithms Maml: sets grads to none * Make changes to update gradients of MAML by setting to None * This is after checking the optimation has doesn't deteriorate it's performance Fix errors in calling zero_grad * Use undeprecated `param.add_(Tensor, alpha)` method to clear deprecation warning * Set grads to None for PEARL * Fix differentiable_sgd runtime error * Add tensor-conversation optimizations for VPG Fix pre-commit errors Fix files permission from 100644 to 100755
- Loading branch information
Showing
17 changed files
with
163 additions
and
94 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
"""PyTorch-backed modules and algorithms.""" | ||
# yapf: disable | ||
from garage.torch._functions import (as_torch, as_torch_dict, | ||
compute_advantages, expand_var, | ||
filter_valids, flatten_batch, | ||
from garage.torch._functions import (as_torch_dict, compute_advantages, | ||
expand_var, filter_valids, flatten_batch, | ||
flatten_to_single_vector, global_device, | ||
NonLinearity, output_height_2d, | ||
output_width_2d, pad_to_last, prefer_gpu, | ||
NonLinearity, np_to_torch, | ||
output_height_2d, output_width_2d, | ||
pad_to_last, prefer_gpu, | ||
product_of_gaussians, set_gpu_mode, | ||
soft_update_model, state_dict_to, | ||
torch_to_np, update_module_params) | ||
|
||
# yapf: enable | ||
__all__ = [ | ||
'compute_advantages', | ||
'NonLinearity', | ||
'as_torch_dict', | ||
'compute_advantages', | ||
'expand_var', | ||
'filter_valids', | ||
'flatten_batch', | ||
'flatten_to_single_vector', | ||
'global_device', | ||
'as_torch', | ||
'np_to_torch', | ||
'output_height_2d', | ||
'output_width_2d', | ||
'pad_to_last', | ||
'prefer_gpu', | ||
'product_of_gaussians', | ||
'set_gpu_mode', | ||
'soft_update_model', | ||
'state_dict_to', | ||
'torch_to_np', | ||
'update_module_params', | ||
'NonLinearity', | ||
'flatten_to_single_vector', | ||
'output_width_2d', | ||
'output_height_2d', | ||
'expand_var', | ||
'state_dict_to', | ||
] |
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.