Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Lunar Lander Test #177

Merged
merged 1 commit into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions experiments/gym/train_lunar_lander.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def create_actor_critic_agents(
policy = policy.to(device)
policy_proxy = FeatureAgentProxy(policy, device=device)
ln_alpha = torch.tensor(np.log(init_alpha), requires_grad=True, device=device)
return q1, q2, policy_proxy, ln_alpha
return q1, q2, policy_proxy, ln_alpha, policy


def create_train_callbacks(
Expand Down Expand Up @@ -354,7 +354,7 @@ def create_complementary_callbacks(
)

"""Creating the actor (policy) and critics (the two Q-functions) agents """
qnet1, qnet2, agent_proxy, ln_alpha = create_actor_critic_agents(
qnet1, qnet2, agent_proxy, ln_alpha, policy = create_actor_critic_agents(
args=input_args, num_actions=number_of_actions, num_obs=number_of_obs
)

Expand All @@ -363,6 +363,7 @@ def create_complementary_callbacks(
args=input_args,
q1=qnet1,
q2=qnet2,
policy=policy,
policy_proxy=agent_proxy,
ln_alpha=ln_alpha,
env=gym_wrapper,
Expand Down