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

Baselines of grid dispatching competition #709

Merged
merged 7 commits into from
Aug 27, 2021

Conversation

zenghsh3
Copy link
Contributor

No description provided.

@@ -0,0 +1,7 @@
## Baselines for grid dispatching competition
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can write in Chinese. The participants only come from China.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some of the participants are from Portugal.

return env


if __name__ == '__main__':
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can remove the test code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

low_bound = gen_p_action_space.low
high_bound = gen_p_action_space.high

mapped_action = low_bound + (action - (-1.0)) * (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why don't we use the action_mapping wrapper here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The current wrapper cannot support it. (We fix it in #673)



class MaxTimestepWrapper(gym.Wrapper):
def __init__(self, env):
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we pass the max_timestep her instead of declaring it globally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

critic_lr=CRITIC_LR)
self.agent = GridAgent(algorithm)

self.agent.restore("./paddle_pretrain_model")
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if the model does not exist?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will raise an exception.


2. Update the data path for distributed training (Using an absoluate path).
```bash
export PWD=`pwd`
Copy link
Collaborator

Choose a reason for hiding this comment

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

this line does not support the Windows system.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added Linux dependency.


xparl start --port 8010 --cpu_num 6
```

Copy link
Collaborator

Choose a reason for hiding this comment

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

Note that you only need to start the cluster once.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added

xparl start --port 8010 --cpu_num 6
```

5. Run training script
Copy link
Collaborator

Choose a reason for hiding this comment

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

start training.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

python train.py --actor_num 6
```

6. Visualize
Copy link
Collaborator

Choose a reason for hiding this comment

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

visualize the training curve and other information.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -0,0 +1,60 @@
## SAC baseline for grid dispatching competition

In this example, we provide a distributed SAC baseline based on PARL and paddlepaddle to solve the [grid dispatching competition](https://aistudio.baidu.com/aistudio/competition/detail/111) task.
Copy link
Collaborator

Choose a reason for hiding this comment

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

to solve the task -> for the task.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

In this example, we provide a distributed SAC baseline based on PARL and paddlepaddle to solve the [grid dispatching competition](https://aistudio.baidu.com/aistudio/competition/detail/111) task.

### Dependencies
* python3
Copy link
Collaborator

Choose a reason for hiding this comment

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

python3.7+

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added python3.6+

Copy link
Collaborator

@TomorrowIsAnOtherDay TomorrowIsAnOtherDay left a comment

Choose a reason for hiding this comment

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

LGTM.

@TomorrowIsAnOtherDay TomorrowIsAnOtherDay merged commit 7a910d3 into develop Aug 27, 2021
@zenghsh3 zenghsh3 deleted the grid_baselines branch January 20, 2022 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants