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)
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)
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))))
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)
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)