From 93d8d45fbd936ecc63aef2726ad13fdd716583fb Mon Sep 17 00:00:00 2001 From: dnddnjs Date: Sat, 21 Jul 2018 15:31:47 +0900 Subject: [PATCH] change hyparams.py to argparser --- unity/env/unity-environment.log | 2 +- unity/main.py | 2 +- unity/model.py | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/unity/env/unity-environment.log b/unity/env/unity-environment.log index 76124d5..175af5f 100644 --- a/unity/env/unity-environment.log +++ b/unity/env/unity-environment.log @@ -1,2 +1,2 @@ -7/21/2018 2:02:54 PM +7/21/2018 2:51:48 PM diff --git a/unity/main.py b/unity/main.py index 2432622..b881ba7 100644 --- a/unity/main.py +++ b/unity/main.py @@ -11,7 +11,7 @@ from unity.unityagents import UnityEnvironment parser = argparse.ArgumentParser(description='Setting for unity walker agent') -parser.add_argument('--render', default=False, +parser.add_argument('--render', default=True, help='if you dont want to render, set this to True') parser.add_argument('--load_model', default=None) parser.add_argument('--gamma', default=0.995, help='discount factor') diff --git a/unity/model.py b/unity/model.py index 50170c1..71ed68e 100644 --- a/unity/model.py +++ b/unity/model.py @@ -9,10 +9,10 @@ def __init__(self, num_inputs, num_outputs, args): self.num_inputs = num_inputs self.num_outputs = num_outputs super(Actor, self).__init__() - self.fc1 = nn.Linear(num_inputs, args.hidden) - self.fc2 = nn.Linear(args.hidden, args.hidden) - self.fc3 = nn.Linear(args.hidden, args.hidden) - self.fc4 = nn.Linear(args.hidden, num_outputs) + self.fc1 = nn.Linear(num_inputs, args.hidden_size) + self.fc2 = nn.Linear(args.hidden_size, args.hidden_size) + self.fc3 = nn.Linear(args.hidden_size, args.hidden_size) + self.fc4 = nn.Linear(args.hidden_size, num_outputs) self.fc4.weight.data.mul_(0.1) self.fc4.bias.data.mul_(0.0) @@ -42,9 +42,9 @@ def forward(self, x): class Critic(nn.Module): def __init__(self, num_inputs, args): super(Critic, self).__init__() - self.fc1 = nn.Linear(num_inputs, args.hidden) - self.fc2 = nn.Linear(args.hidden, args.hidden) - self.fc3 = nn.Linear(args.hidden, 1) + self.fc1 = nn.Linear(num_inputs, args.hidden_size) + self.fc2 = nn.Linear(args.hidden_size, args.hidden_size) + self.fc3 = nn.Linear(args.hidden_size, 1) self.fc3.weight.data.mul_(0.1) self.fc3.bias.data.mul_(0.0)