Ejemplo n.º 1
0
    def __init__(self,
                 fidelity: Fidelity,
                 space: Union[Space, Dict],
                 seed=0,
                 **kwargs):
        self.identity = 'uid'

        for k, v in kwargs.items():
            debug(f'used parameter ({k}: {v})')

        if isinstance(space, dict):
            space = Space.from_dict(space)

        if space is not None:
            space.identity(self.identity)

        if isinstance(fidelity, dict):
            fidelity = Fidelity.from_dict(fidelity)

        self.fidelity = fidelity
        self.space = space
        self.seed = seed
        self.seed_time = 0
        self.manual_insert = 0
        self.manual_samples = []
        self.manual_fidelity = []
        self.trials = OrderedDict()
Ejemplo n.º 2
0
    def load_state_dict(self, state):
        state = decompress_dict(state)

        self.space = Space.from_dict(state['space'])
        self.seed = state['seed']
        self.manual_samples = state['manual_samples']
        self.manual_fidelity = state['manual_fidelity']
        self.manual_insert = state['manual_insert']
        self.seed_time = state['seed_time']
        self.fidelity = Fidelity.from_dict(state['fidelity'])
        self.trials = OrderedDict(
            (k, Trial.from_dict(t)) for k, t in state['trials'])
        return self