def __init__(self, text=None, label=None, jvalue=None, bigdl_type="float"): self.bigdl_type = bigdl_type if jvalue: self.value = jvalue else: assert isinstance(text, six.string_types), "text of a TextFeature should be a string" if label is not None: self.value = callBigDlFunc(bigdl_type, JavaValue.jvm_class_constructor(self), text, int(label)) else: self.value = callBigDlFunc(bigdl_type, JavaValue.jvm_class_constructor(self), text)
def __init__(self, model, configure=None, bigdl_type="float"): self.bigdl_type = bigdl_type self.value = callBigDlFunc(bigdl_type, JavaValue.jvm_class_constructor(self), model, configure) self.configure = Configure( jvalue=callBigDlFunc(self.bigdl_type, "getConfigure", self.value))
def __init__(self, jvalue, bigdl_type, *args): if (jvalue): assert(type(jvalue) == JavaObject) self.value = jvalue else: self.value = callBigDlFunc( bigdl_type, JavaValue.jvm_class_constructor(self), *args) self.bigdl_type = bigdl_type
def __init__(self, image_rdd=None, label_rdd=None, jvalue=None, bigdl_type="float"): assert jvalue or image_rdd, "jvalue and image_rdd cannot be None in the same time" if jvalue: self.value = jvalue else: # init from image ndarray rdd and label rdd(optional) image_tensor_rdd = image_rdd.map(lambda image: JTensor.from_ndarray(image)) label_tensor_rdd = label_rdd.map(lambda label: JTensor.from_ndarray(label)) if label_rdd else None self.value = callBigDlFunc(bigdl_type, JavaValue.jvm_class_constructor(self), image_tensor_rdd, label_tensor_rdd) self.bigdl_type = bigdl_type
def __init__(self, pre_processor=None, post_processor=None, batch_per_partition=4, label_map=None, feature_padding_param=None, jvalue=None, bigdl_type="float"): self.bigdl_type = bigdl_type if jvalue: self.value = jvalue else: if pre_processor: assert issubclass(pre_processor.__class__, Preprocessing), \ "the pre_processor should be subclass of Preprocessing" if post_processor: assert issubclass(post_processor.__class__, Preprocessing), \ "the pre_processor should be subclass of Preprocessing" self.value = callBigDlFunc( bigdl_type, JavaValue.jvm_class_constructor(self), pre_processor, post_processor, batch_per_partition, label_map, feature_padding_param)
def __init__(self, pre_processor=None, post_processor=None, batch_per_partition=4, label_map=None, feature_padding_param=None, jvalue=None, bigdl_type="float"): self.bigdl_type=bigdl_type if jvalue: self.value = jvalue else: if pre_processor: assert pre_processor.__class__.__bases__[0].__name__ == "FeatureTransformer",\ "the pre_processor should be subclass of FeatureTransformer" if post_processor: assert post_processor.__class__.__bases__[0].__name__ == "FeatureTransformer", \ "the pre_processor should be subclass of FeatureTransformer" self.value = callBigDlFunc( bigdl_type, JavaValue.jvm_class_constructor(self), pre_processor, post_processor, batch_per_partition, label_map, feature_padding_param)
def __init__(self, jvalue, bigdl_type, *args): self.value = jvalue if jvalue else callBigDlFunc( bigdl_type, JavaValue.jvm_class_constructor(self), *args) self.bigdl_type = bigdl_type
def __init__(self, image=None, label=None, path=None, bigdl_type="float"): image_tensor = JTensor.from_ndarray(image) if image is not None else None label_tensor = JTensor.from_ndarray(label) if label is not None else None self.bigdl_type = bigdl_type self.value = callBigDlFunc( bigdl_type, JavaValue.jvm_class_constructor(self), image_tensor, label_tensor, path)
def __init__(self, bigdl_type="float", *args): self.value = callBigDlFunc( bigdl_type, JavaValue.jvm_class_constructor(self), *args)
def __init__(self, bigdl_type="float"): self.value = callZooFunc(bigdl_type, JavaValue.jvm_class_constructor(self))
def __init__(self, label_map, clses, probs, bigdl_type="float"): self.value = callBigDlFunc(bigdl_type, JavaValue.jvm_class_constructor(self), label_map, clses, probs)
def __init__(self, label_map, thresh=0.3, encoding="png", bigdl_type="float"): self.value = callBigDlFunc( bigdl_type, JavaValue.jvm_class_constructor(self), label_map, thresh, encoding)