Modified demo config and run demo script (#83)

* Add removed q_dot scaling factor

* Refactored cubic function

* Separate config and add run file.

* Resolve flake8 issue

* Resolve flake8 issue

* Remove whitespace before ( issue
This commit is contained in:
Whi Kwon
2019-07-12 01:26:34 +09:00
committed by GitHub
parent 2f8dbf5249
commit 0fac485205
14 changed files with 90 additions and 115 deletions
+3 -3
View File
@@ -225,7 +225,7 @@ class Agent(AbstractAgent):
def load_params(self, path):
"""Load model and optimizer parameters."""
if not os.path.exists(path):
print ("[ERROR] the input path does not exist. ->", path)
print("[ERROR] the input path does not exist. ->", path)
return
params = torch.load(path)
@@ -242,7 +242,7 @@ class Agent(AbstractAgent):
if self.hyper_params["AUTO_ENTROPY_TUNING"]:
self.alpha_optimizer.load_state_dict(params["alpha_optim"])
print ("[INFO] loaded the model and optimizer from", path)
print("[INFO] loaded the model and optimizer from", path)
def save_params(self, n_episode):
"""Save model and optimizer parameters."""
@@ -267,7 +267,7 @@ class Agent(AbstractAgent):
"""Write log about loss and score"""
total_loss = loss.sum()
print (
print(
"[INFO] episode %d, episode_step %d, total step %d, total score: %d\n"
"total loss: %.3f actor_loss: %.3f qf_1_loss: %.3f qf_2_loss: %.3f "
"vf_loss: %.3f alpha_loss: %.3f\n"