浏览代码

minor fixes

/trainer-plugin
Anupam Bhatnagar 4 年前
当前提交
71c301bc
共有 2 个文件被更改,包括 7 次插入6 次删除
  1. 9
      ml-agents/mlagents/trainers/learn.py
  2. 4
      ml-agents/mlagents/trainers/policy/tf_policy.py

9
ml-agents/mlagents/trainers/learn.py


name: importlib.import_module(name)
for finder, name, ispkg in pkgutil.iter_modules(paths)
}
logger.info(f"The following plugins are available {discovered_plugins}")
if discovered_plugins:
logger.info(f"The following plugins are available {discovered_plugins}")
if len(new_initializers) <= 0:
return
if len(new_initializers) == 0:
return []
elif len(new_initializers) == 1:
# load the initializer
logger.info("Registering new initializer")

return new_trainers
else:
raise ValueError(
"there should be exactly one initializer passed through plugins option"
"There should be exactly one initializer passed through plugins option."
)

4
ml-agents/mlagents/trainers/policy/tf_policy.py


GaussianDistribution,
MultiCategoricalDistribution,
)
from mlagents.tf_utils.global_values import get_rank
from mlagents.tf_utils import global_values
logger = get_logger(__name__)

self.grads = None
self.update_batch: Optional[tf.Operation] = None
self.trainable_variables: List[tf.Variable] = []
self.rank = get_rank()
self.rank = global_values.get_rank()
if create_tf_graph:
self.create_tf_graph()

正在加载...
取消
保存