Skip to content

Commit

Permalink
change hyparams.py to argparser
Browse files Browse the repository at this point in the history
  • Loading branch information
dnddnjs committed Jul 21, 2018
1 parent da10bd8 commit 93d8d45
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion unity/env/unity-environment.log
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
7/21/2018 2:02:54 PM
7/21/2018 2:51:48 PM

2 changes: 1 addition & 1 deletion unity/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
14 changes: 7 additions & 7 deletions unity/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)

Expand Down

1 comment on commit 93d8d45

@dnddnjs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#2 hyper-params를 argparser로 설정할 수 있도록 변경 --> 완료

Please sign in to comment.