Git Product home page Git Product logo

pyracing's People

Contributors

monokim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pyracing's Issues

Could you try and explain the code a bit further to me?

Hi,

I'm trying to make a sim ilar game with q-learning but I just don't really understand what your code is saying.
I would very much appreciate it if you could explain it in some way or maybe we can run through the code on Discord?

thanks in advance

Trouble understanding load_and_play

Hello @monokim i am a student intrested in your work. I am quite new to python so i am having some trouble understanding how the lines under the 'def load_and_play' work and how i can access this line of code as i have not seen this pop up ("Start loading history"). If you could explain to me how this works i would most appreciate it. Here is the code for reference:

def load_and_play():

print("Start loading history")

history_list = ['30000.npy']



# load data from history file

print("Start updating q_table")

discount_factor = 0.99

for list in history_list:

    history = load_data(list)

    learning_rate = get_learning_rate(0)

    print(list)

    file_size = len(history)

    print("file size : " + str(file_size))

    i = 0

    for data in history:

        state_0, action, reward, state, done = data

        best_q = np.amax(q_table[state])

        q_table[state_0 + (action,)] += learning_rate * (reward + discount_factor * (best_q) - q_table[state_0 + (action,)])

        if done == True:

            i += 1

            learning_rate = get_learning_rate(i)`

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.