Ejemplo n.º 1
0
    def __init__(self, config, args):
        self.saver = save.Saver(config.NPOP, config.MODELDIR,
                                'models', 'bests', 'lawmaker', resetTol=256)
        self.config, self.args = config, args
        self.agentEntropies = np.repeat(self.config.ENTROPY, self.args.nRealm)

        self.init()
        if self.config.LOAD or self.config.BEST:
            self.load(self.config.BEST)
Ejemplo n.º 2
0
    def __init__(self, ann, config, args):
        self.saver = save.Saver(config.MODELDIR,
                                'models',
                                'bests',
                                resetTol=256)
        self.config, self.args = config, args

        self.init(ann)
        if self.config.LOAD or self.config.BEST:
            self.load(self.config.BEST)
Ejemplo n.º 3
0
    def __init__(self, ann, config):
        self.saver = save.Saver(config.MODELDIR,
                                'models',
                                'bests',
                                resetTol=256)
        self.config = config

        print('Initializing new model...')
        self.net = ann(config)
        self.parameters = Parameter(
            torch.Tensor(np.array(getParameters(self.net))))
Ejemplo n.º 4
0
    def __init__(self, config, args):
        self.saver = save.Saver(config.NPOP,
                                config.MODELDIR,
                                'models',
                                'bests',
                                'lawmaker',
                                resetTol=256)
        self.config, self.args = config, args
        self.nANN = config.NPOP
        self.envNets = []

        self.init()
        if self.config.LOAD or self.config.BEST:
            self.load(self.config.BEST)
Ejemplo n.º 5
0
    def __init__(self, ann, config):
        self.saver = save.Saver(config.MODELDIR,
                                'models',
                                'bests',
                                resetTol=256)
        self.config = config

        print('Initializing new model...')
        self.net = ann(config)
        self.parameters = Parameter(
            torch.Tensor(np.array(getParameters(self.net))))

        #Have been experimenting with population based
        #training. Nothing stable yet -- advise avoiding
        if config.POPOPT:
            self.opt = PopulationOptimizer(self, config)
        else:
            self.opt = GradientOptimizer(self, config)

        if config.LOAD or config.BEST:
            self.load(self.opt, config.BEST)