Giter Club home page Giter Club logo

Comments (8)

flobotics avatar flobotics commented on September 27, 2024

i am sorry, my code is wrong, this si more correct

import numpy as np

a = np.array([[1,2,3],[4,5,6]])
print a.shape
print a
b = np.stack(tuple(a for _ in range(4)), axis=2)
print b.shape
print b
c = np.array([[7,8,9], [10,11,12]])
print c.shape
print c
d = np.reshape(c, (2,3,1))
print d.shape
e = np.append(b[:,:,1:], d, axis=2)
print e.shape
print e
f = np.array([[13,14,15],[16,17,18]])
g = np.reshape(f, (2,3,1))
h = np.append(e[:,:,1:], g, axis=2)
print h.shape
print h

from pygameplayer.

DanielSlater avatar DanielSlater commented on September 27, 2024

Hi Flo, Sorry just to check it's OK in it's current form?(I very much hope so)

from pygameplayer.

flobotics avatar flobotics commented on September 27, 2024

hi @DanielSlater
sorry for stress. i hope it will also work with my code :)

from pygameplayer.

DanielSlater avatar DanielSlater commented on September 27, 2024

No problem, glad your finding it useful :) if you do find bugs, very happy for you to tell me so I can fix them.

from pygameplayer.

flobotics avatar flobotics commented on September 27, 2024

very useful, thanks alot
i dont think so, but if i find one, i will send issue to you

from pygameplayer.

flobotics avatar flobotics commented on September 27, 2024

hi @DanielSlater ,
i just wanna ask, how do you extract the data from self._observations ? you do it on line 152 https://github.com/DanielSlater/PyGamePlayer/blob/master/examples/deep_q_pong_player.py#L152
but when i try to do it the same way like you, i get the error:

TypeError: tuple indices must be integers, not list

i searched alot on web but cannot find anything that helps me, perhaps you could help me

my line of code is here, line 317
https://github.com/flobotics/flobotics_tensorflow_controller/blob/master/nodes/listener.py#L317

from pygameplayer.

DanielSlater avatar DanielSlater commented on September 27, 2024

Hi @flobotics
So the problem you have here is that in your code the line
OBS_LAST_STATE_INDEX = range(5)

Give you a tuple, contrast that with the line in PyGamePlayer

OBS_LAST_STATE_INDEX, OBS_ACTION_INDEX, OBS_REWARD_INDEX, OBS_CURRENT_STATE_INDEX, OBS_TERMINAL_INDEX = range(5)

In PyGamePlayer because of python unpacking OBS_LAST_STATE_INDEX will be an int. In your version it will be a tuple(the number 1 through 5).

Hope this helps

from pygameplayer.

flobotics avatar flobotics commented on September 27, 2024

aaahh, got it, after days :) thank you

from pygameplayer.

Related Issues (10)

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.