def __init__(self, config): self.query_f = Queries.get_by_name(config['query']) self.score_f = Scores.get_by_name(config['score']) self.create_model = Models.get_by_name(config['model']) if 'encoder' in config: self.create_encoder = Encoders.get_by_name(config['encoder']) self.init_size = config['init_size'] self.batch_size = config['batch_size'] self.total_size = config['total_size'] self.queries_number = config['queries_number'] self.random_state = config['random_state']
def set_score_f(self, raw_score): score = Scores.get_by_name(raw_score) res = copy.deepcopy(self) res.score_f = score return res