def __init__(self, work_dir: str = None): if work_dir is None: work_dir = tempfile.mkdtemp(prefix=f"generator-model-{datetime.datetime.today():%d-%m-%Y-%H-%M-%S}") self.work_dir = work_dir self.model_map: Dict[OpInfo, TrainableSerializableModel] = {} self.model_paths: Dict[OpInfo, str] = {} self.op_info_mapping: Dict[OpInfo, OpInfo] = {} self.model_definitions = find_known_operators(self)
def __init__(self): self.edge_type_mapping = {} self.node_feature_mapping = {} for idx, etype in enumerate(EdgeTypes.__members__.keys()): self.edge_type_mapping[etype] = idx for idx, feature in enumerate({ **NodeDataTypes.__members__, **NodeRoles.__members__, **NodeSources.__members__ }.keys()): self.node_feature_mapping[feature] = idx self.encoder_definitions = find_known_operators(self)
def __init__(self): self.known_ops = find_known_operators(self) self.known_methods = find_known_methods(self)
def __setstate__(self, state): self.__dict__.update(state) self.model_map: Dict[OpInfo, TrainableModel] = {} self.model_paths: Dict[OpInfo, str] = {} self.model_definitions = find_known_operators(self)