def load_agent(num, work_dir, load_args): file_path = os.path.join(work_dir, 'agent_%08d.hdf5' % num) with h5py.File(file_path, 'r') as h5file: agent = decode_agent(h5file) agent.set_num_rounds(load_args.nr) agent.set_c(load_args.c) agent.set_concent_param(load_args.cp) agent.set_dirichlet_weight(load_args.dw) return agent
def load_agent(ag_num, num, work_dir, load_args): file_path = os.path.join(work_dir, 'agent_%08d.hdf5' % num) with h5py.File(file_path, 'r') as h5file: agent = decode_agent(h5file) if ag_num == 1: agent.set_num_rounds(load_args.nr1) agent.set_c(load_args.c1) agent.set_concent_param(load_args.cp1) agent.set_dirichlet_weight(load_args.dw1) else: agent.set_num_rounds(load_args.nr2) agent.set_c(load_args.c2) agent.set_concent_param(load_args.cp2) agent.set_dirichlet_weight(load_args.dw2) return agent
def load_agent(filename): with h5py.File(filename, 'r') as h5file: return decode_agent(h5file)