Code Monkey home page Code Monkey logo

Comments (1)

EmanueleLM avatar EmanueleLM commented on August 27, 2024

I'm almost there to solve the problem, still some issues.

If you modify atari_wrappers.py, class 'WarpFrame' to this version:

class WarpFrame(gym.ObservationWrapper):
    def __init__(self, env, show_warped=False):
        """Warp frames to 84x84 as done in the Nature paper and later work."""
        gym.ObservationWrapper.__init__(self, env)

        if 'SpaceInvaders' in str(env):
            self.res1, self.res2 = 210, 160
        else:
            self.res1, self.res2 = 84, 84
        self.observation_space = spaces.Box(low=0, high=255, shape=(self.res1, self.res2, 1))
        self.viewer = None
        self.show_warped = show_warped

And add this to the first part of the function 'wrap_deepmind':

def wrap_deepmind(env, episode_life=False, skip=4, stack_frames=4, noop_max=30, noops=None, show_warped=False):
    """Configure environment for DeepMind-style Atari.
    Note: this does not include frame stacking!""" 
    if 'SpaceInvaders' in str(env):
        stack_frames = 3

Once this part is done, if you run the viz.py it works, but it doesn't play as better as 'standard' Atari games like Frtosbite: please note that this happens despite the snapshot indicates a higher score than what is then shown by viz.py.

If I modify the first line after the declaration of the function '_observation(self, obs)', that stores a 'stubbed' numpy array of magical floats, the behavior of the net and the scores change dramatically, so I'd like to ask what this array is meant to store.
The Github version is the following:

    def _observation(self, obs):
        frame = np.dot(obs.astype('float32'), np.array([0.299, 0.587, 0.114], 'float32'))  # real black magic?

from deep-neuroevolution.

Related Issues (20)

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.