import argparse

"""
Makes a DeepQ Agent and runs it through one fight for each character in the roster so the user can view it
"""
if __name__ == "__main__":
    parser = argparse.ArgumentParser(description= 'Imports the specified class library and loads the specificed model.')
    parser.add_argument('-cn', '--className', type= str, default= "DeepQAgent", help= 'Name of the class library to import')
    parser.add_argument('-mn', '--modelName', type= str, default= None, help= 'Name of the specific model to be loaded and tested')
    parser.add_argument('-l', '--load', action= 'store_true', help= 'Boolean flag for if the user wants to load pre-existing weights')
    parser.add_argument('-c', '--character', type= str,  default= "ryu", help= 'The specific character this agent will play')

    args = parser.parse_args()
    if args.className is None:
        args.modelName = args.className

    agent = None
    exec("from {0} import {0}".format(args.className))
    exec("agent = {0}(load= {1}, name= \"{2}\", character= \"{3}\")".format(args.className, args.load, args.modelName, args.character))
    from Lobby import Lobby
    testLobby = Lobby()
    testLobby.addPlayer(agent)
    testLobby.executeTrainingRun(review= False, render= True)
Beispiel #2
0
            The training data for the model
        
        model
            The model for the function to train

        Returns
        -------
        model
            The now trained and hopefully improved model
        """
        raise NotImplementedError("Implement this is in the inherited agent")

    ### End of Abstract methods


if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='Processes agent parameters.')
    parser.add_argument(
        '-r',
        '--render',
        action='store_true',
        help=
        'Boolean flag for if the user wants the game environment to render during play'
    )
    args = parser.parse_args()
    from Lobby import Lobby
    testLobby = Lobby(render=args.render)
    agent = Agent()
    testLobby.addPlayer(agent)
    testLobby.executeTrainingRun()
        'Boolean flag for if the user wants the game environment to render during play'
    )
    parser.add_argument(
        '-l',
        '--load',
        action='store_true',
        help='Boolean flag for if the user wants to load pre-existing weights')
    parser.add_argument(
        '-e',
        '--episodes',
        type=int,
        default=10,
        help=
        'Intger representing the number of training rounds to go through, checkpoints are made at the end of each episode'
    )
    parser.add_argument(
        '-n',
        '--name',
        type=str,
        default=None,
        help=
        'Name of the instance that will be used when saving the model or it\'s training logs'
    )
    args = parser.parse_args()
    qAgent = DeepQAgent(load=args.load, name=args.name)

    from Lobby import Lobby
    testLobby = Lobby()
    testLobby.addPlayer(qAgent)
    testLobby.executeTrainingRun(episodes=args.episodes, render=args.render)
from DeepQAgent import *
"""Makes a DeepQ Agent and runs it through one fight for each character in the roster so the user can view it"""
if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='Processes agent parameters.')
    parser.add_argument(
        '-n',
        '--name',
        type=str,
        default=None,
        help=
        'Name of the instance that will be used when saving the model or it\'s training logs'
    )
    args = parser.parse_args()
    qAgent = DeepQAgent(load=True, epsilon=0, name=args.name)

    from Lobby import Lobby
    testLobby = Lobby(render=True)
    testLobby.addPlayer(qAgent)
    testLobby.executeTrainingRun(review=False)
Beispiel #5
0
        'Boolean flag for if the user wants the game environment to render during play'
    )
    parser.add_argument(
        '-l',
        '--load',
        action='store_true',
        help='Boolean flag for if the user wants to load pre-existing weights')
    parser.add_argument(
        '-e',
        '--episodes',
        type=int,
        default=10,
        help=
        'Intger representing the number of training rounds to go through, checkpoints are made at the end of each episode'
    )
    parser.add_argument(
        '-n',
        '--name',
        type=str,
        default=None,
        help=
        'Name of the instance that will be used when saving the model or it\'s training logs'
    )
    args = parser.parse_args()
    qAgent = DeepQAgent(load=args.load, name=args.name)

    from Lobby import Lobby
    testLobby = Lobby(render=args.render)
    testLobby.addPlayer(qAgent)
    testLobby.executeTrainingRun(episodes=args.episodes)