agent.py
def main(args):
    """
    Sets up the environment, loads the agent, prepares the
    first action and moves the game a single frame
    and then enters the agents main loop
    """
    log.info('Verbose output enabled ' + str(log.getLogger().getEffectiveLevel()))
    log.debug(args)

    npixels, nactions, nimages = 80, 3, 4
    agent = DeepLearningAgent(npixels, npixels, nactions, nimages, args.reset, args.train)
    log.info('agent loaded successfully')

    agent.environment.first_to = [args.ngames, args.nmatches]
    log.info('we are playing ' + str(args.ngames) +
             ' games of ' + str(args.nmatches) +
             ' matches each - Good luck!!!')

    noop = np.zeros(nactions)
    noop[0] = 1 # 0 action is do nothing, 1 is up, 2 is down
    raw_percept, _ = agent.environment.frame_step(noop)
    log.info('pumping first frame on the game state')

    x_t = agent.perception.preprocess_percepts(raw_percept, False)
    first_percept_stack = np.stack((x_t, x_t, x_t, x_t), axis = 2)
    log.info('first stack created successfully')

    agent.load_progress()
    log.info('agent load progress completed')

    agent.exist(first_percept_stack)
    log.info('agent dies')

    Sets up the environment, loads the agent, prepares the
    first action and moves the game a single frame
    and then enters the agents main loop
    
Sets up the environment, loads the agent, prepares the
first action and moves the game a single frame
and then enters the agents main loop
Sets up the environment loads the agent prepares the first action and moves the game a single frame and then enters the agents main loop
def main(args):
    log.info('Verbose output enabled ' + str(log.getLogger().getEffectiveLevel()))
    log.debug(args)
    npixels, nactions, nimages = 80, 3, 4
    agent = DeepLearningAgent(npixels, npixels, nactions, nimages, args.reset, args.train)
    log.info('agent loaded successfully')
    agent.environment.first_to = [args.ngames, args.nmatches]
    log.info('we are playing ' + str(args.ngames) +
             ' games of ' + str(args.nmatches) +
             ' matches each - Good luck!!!')
    noop = np.zeros(nactions)
    noop[0] = 1 
    raw_percept, _ = agent.environment.frame_step(noop)
    log.info('pumping first frame on the game state')
    x_t = agent.perception.preprocess_percepts(raw_percept, False)
    first_percept_stack = np.stack((x_t, x_t, x_t, x_t), axis = 2)
    log.info('first stack created successfully')
    agent.load_progress()
    log.info('agent load progress completed')
    agent.exist(first_percept_stack)
    log.info('agent dies')
def main ( args ) : log . info ( 'Verbose output enabled ' + str ( log . getLogger ( ) . getEffectiveLevel ( ) ) ) log . debug ( args ) npixels , nactions , nimages = 80 , 3 , 4 agent = DeepLearningAgent ( npixels , npixels , nactions , nimages , args . reset , args . train ) log . info ( 'agent loaded successfully' ) agent . environment . first_to = [ args . ngames , args . nmatches ] log . info ( 'we are playing ' + str ( args . ngames ) + ' games of ' + str ( args . nmatches ) + ' matches each - Good luck!!!' ) noop = np . zeros ( nactions ) noop [ 0 ] = 1 raw_percept , _ = agent . environment . frame_step ( noop ) log . info ( 'pumping first frame on the game state' ) x_t = agent . perception . preprocess_percepts ( raw_percept , False ) first_percept_stack = np . stack ( ( x_t , x_t , x_t , x_t ) , axis = 2 ) log . info ( 'first stack created successfully' ) agent . load_progress ( ) log . info ( 'agent load progress completed' ) agent . exist ( first_percept_stack ) log . info ( 'agent dies' )
Sets up the environment, loads the agent, prepares the
first action and moves the game a single frame
and then enters the agents main loop
Sets up the environment loads the agent prepares the first action and moves the game a single frame and then enters the agents main loop
"""
    Sets up the environment, loads the agent, prepares the
    first action and moves the game a single frame
    and then enters the agents main loop
    """ # 0 action is do nothing, 1 is up, 2 is down
args