Coder Social home page Coder Social logo

irvingao / dqn_with_grid_world_bait_eating_simulator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bumjunjung9287/dqn_with_grid_world_bait_eating_simulator

0.0 0.0 0.0 503 KB

DQN with customed grid_world_game_environment

Python 100.00%

dqn_with_grid_world_bait_eating_simulator's Introduction

DQN_with_grid_world_bait_eating_simulator

Environment

Ubuntu 18.04 pytorch 1.2.0

simulation of grid world for reinforcement learning

Environment class for grid world is in util/utils.py as a class of game_env()

the grid world is formed with 4 x 6 grids and init_state, goal_state, current_state.

In this game, the Agent will choose wether to go up, down, right, left to go to goal

if the agent reaches goal, it will receive + rewards and the next game will begin and the initial state will be the last goal state

if Agent gets out of the grid world, it becomes game over and Agent will recieve - rewards.

you can adjust the amount or conditions oh these rewards in the game_environment and it will affect the training efficiency a lot.

How to run

first, run main.py with no argumets. The model will be trained until 200 epochs and be saved as "model_until_200epoch.model"

$ python3 main.py

if you want to train the saved model, choose the number of games(n_games) you want to train, and number of model(md_num)

(for examplethe number for the model "model_until_200epoch.model" is 200)

and run main.py as

$ python3 main.py -c -n n_games -md md_num

then it will train continuosly.

model

Used simple DQN(Deep Q Network) with 4 FCs(Fully Connected Networks)

E-greedy method with epsilon_max = 0.9 & epsilon_min = 0.01 and epsilon_dec = 0.996 (next_eps = eps / eps_dec)

replay memories are stored in Agent as Agent.state_memory, Agent.new_state_memory ...

Visualization / Images of score

Screenshot from 2019-12-01 20-47-52 Screenshot from 2019-12-01 20-47-28 first 200 epoch scores scores200~250 scores250~300 rewards steps

dqn_with_grid_world_bait_eating_simulator's People

Contributors

bumjunjung9287 avatar

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.