mirror of
https://github.com/wassname/ray.git
synced 2026-07-27 11:26:41 +08:00
[rllib] Validate that entropy coeff is not an integer (#5687)
* Validate that entropy coeff is not an integer Passing an integer value for entropy coeff such as 0 raises an error somewhere inside the TF policy graph, so this checks to make sure the entropy coeff is a float. * Cast to float instead Also move this check after the negative value check
This commit is contained in:
committed by
Eric Liang
parent
faeaa34bdd
commit
946ebfaa3c
@@ -129,6 +129,8 @@ def warn_about_bad_reward_scales(trainer, result):
|
||||
def validate_config(config):
|
||||
if config["entropy_coeff"] < 0:
|
||||
raise DeprecationWarning("entropy_coeff must be >= 0")
|
||||
if isinstance(config["entropy_coeff"], int):
|
||||
config["entropy_coeff"] = float(config["entropy_coeff"])
|
||||
if config["sgd_minibatch_size"] > config["train_batch_size"]:
|
||||
raise ValueError(
|
||||
"Minibatch size {} must be <= train batch size {}.".format(
|
||||
|
||||
Reference in New Issue
Block a user