Commit 823c2139 authored by Dipam Chakraborty's avatar Dipam Chakraborty
Browse files

update random rollout script

parent a4749f1a
......@@ -52,7 +52,7 @@ We are excited that this competition offers machine learning students, researche
# How to run the environment
To be added
Install the environment from the [original nethack repository](https://github.com/facebookresearch/nle)
# How to start participating
......@@ -71,7 +71,7 @@ You can add your SSH Keys to your GitLab account by going to your profile settin
3. **Install** competition specific dependencies!
```
cd neurips-2021-nethack-starter-kit
pip3 install -r requirements.txt
pip install -r requirements.txt
```
4. Try out random prediction codebase present in `test.py`.
......@@ -136,7 +136,7 @@ To be added.
## Contributing
🙏 You can share your solutions or any other baselines by contributing directly to this repository by opening merge request.
You can share your solutions or any other baselines by contributing directly to this repository by opening merge request.
- Add your implemntation as `test_<approach-name>.py`
- Test it out using `python test_<approach-name>.py`
......@@ -147,6 +147,8 @@ To be added.
## Contributors
- [Shivam Khandelwal](https://www.aicrowd.com/participants/shivam)
- [Jyotish Poonganam](https://www.aicrowd.com/participants/jyotish)
- [Dipam chakraborty](https://www.aicrowd.com/participants/dipam)
# 📎 Important links
......
......@@ -7,9 +7,7 @@ This file will help you in making your first submission.
The evaluator will execute `run.sh` for generating predictions, so please remember to include it in your submission!
The inline documentation of `test.py` will guide you with interfacing with the codebase properly. You can check TODOs inside it to learn about the functions you need to implement.
You can modify the existing `test.py` OR copy it (to say `your_code.py`) and change it.
You can modify the existing `rollout.py` OR copy it (to say `your_code.py`) and change it.
## IMPORTANT: Saving Models before submission!
......
#!/usr/bin/env python
# This file is the entrypoint for your submission
# You can modify this file to include your code or directly call your functions/modules from here.
import aicrowd_gym
import nle
def main():
"""
This function will be called for training phase.
"""
# This allows us to limit the features of the environment
# that we don't want participants to use during the submission
env = aicrowd_gym.make("NetHackScore-v0")
env = aicrowd_gym.make("NetHackScore-v0")
env.reset()
done = False
episode_count = 0
while episode_count < 20:
_, _, done, _ = env.step(env.action_space.sample())
if done:
episode_count += 1
print(episode_count)
env.reset()
if __name__ == "__main__":
main()
#!/bin/bash
python predict.py
python rollout.py
#!/usr/bin/env python
# This file is the entrypoint for your submission.
# You can modify this file to include your code or directly call your functions/modules from here.
def main():
"""
This function will be called for training phase.
"""
# Sample code for illustration, add your training code below
env = gym.make("NetHackScore-v0")
# actions = [env.action_space.sample() for _ in range(10)] # Just doing 10 samples in this example
# xposes = []
# for _ in range(1):
# obs = env.reset()
# done = False
# netr = 0
# # Limiting our code to 1024 steps in this example, you can do "while not done" to run till end
# while not done:
# To get better view in your training phase, it is suggested
# to register progress continuously, example when 54% completed
# aicrowd_helper.register_progress(0.54)
# Save trained model to train/ directory
# Training 100% Completed
aicrowd_helper.register_progress(1)
#env.close()
if __name__ == "__main__":
main()
#!/usr/bin/env python
# This file is the entrypoint for your submission.
# You can modify this file to include your code or directly call your functions/modules from here.
def main():
"""
This function will be called for training phase.
"""
# Sample code for illustration, add your training code below
env = gym.make("NetHackScore-v0")
# actions = [env.action_space.sample() for _ in range(10)] # Just doing 10 samples in this example
# xposes = []
# for _ in range(1):
# obs = env.reset()
# done = False
# netr = 0
# # Limiting our code to 1024 steps in this example, you can do "while not done" to run till end
# while not done:
# To get better view in your training phase, it is suggested
# to register progress continuously, example when 54% completed
# aicrowd_helper.register_progress(0.54)
# Save trained model to train/ directory
# Training 100% Completed
aicrowd_helper.register_progress(1)
#env.close()
if __name__ == "__main__":
main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment