Giter Site home page Giter Site logo

justjoshtings / ms.pacman.ai Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 79.41 MB

Trained a reinforcement learning agent to play the Atari 2600 game of Ms. Pac-Man. Built a web-app to live stream gameplay with TCP/IP in real-time with Flask as the app interface.

License: MIT License

Python 6.79% Jupyter Notebook 91.48% HTML 0.29% Shell 0.45% CSS 0.25% JavaScript 0.75%
reinforcement-learning deep-reinforcement-learning ai-games dqn flask webapp artificial-intelligence reactjs arcade-learning-environment openai-gym

ms.pacman.ai's Introduction

Image

Data Scientist and Data Engineer

Leveraging my background in tech, clean energy engineering, and data science/machine learning to drive solutions in climate and sustainability.

Learn more about me and my work at my personal website.

ms.pacman.ai's People

Contributors

adamkritz avatar justjoshtings avatar saharae avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

ms.pacman.ai's Issues

Reviewed GPU Final Script

Hey @adamkritz, just looked at the GPU final script and thanks for doing all that stuff, it looks good!

Up to you but feel free to remove this random model part if you want as that's not needed for training.

print('Begin Random Model')
skip = False
if not skip:
# Run for 1000 games
episodes = 1000
random_model_scores = []
random_model_steps = []
for episode in range(1, episodes+1):
state = env.reset()
done = False
score = 0
steps = 0
while not done:
action = random.choice([0,1,2,3,4,5,6,7,8])
n_state, reward, done, info = env.step(action)
score += reward
steps += 1
print('Episode:{} Score:{} Steps:{}'.format(episode, score, steps))
# env.play()
random_model_scores.append(score)
random_model_steps.append(steps)
env.close()
print('random model finished playing')
# Make scores results directory;
random_model_scores_file = abspath_curr + '/results/random_model_scores_1k_episodes_3_9_22.txt'
random_model_steps_file = abspath_curr + '/results/random_model_steps_1k_episodes_3_9_22.txt'
print('Made Random Model Text Files')
# Save random_model_scores
random_model_scores = np.array(random_model_scores)
random_model_steps = np.array(random_model_steps)
np.savetxt(random_model_scores_file, random_model_scores, fmt='%d')
np.savetxt(random_model_steps_file, random_model_steps, fmt='%d')
print('Saved Random Model Scores')

Also don't forget to set nb_steps to something like 600k for the 1mill. This will give it sufficient number of steps to got from 1.0 eps to 0.1 eps.

policy = LinearAnnealedPolicy(EpsGreedyQPolicy(), attr='eps', value_max=1., value_min=.1, value_test=.1, nb_steps=8000) # For 1 million total steps, I think having the policy nb_steps around 600k is a good slope.

Also, let's try memory limit to be 500k cause why not lol.

memory = SequentialMemory(limit=100000, window_length=window_length)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.