예제 #1
0
 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)
예제 #2
0
 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))
예제 #3
0
파일: optimizer.py 프로젝트: ru003ar/BigDL
 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
예제 #4
0
파일: image.py 프로젝트: ysluodz/BigDL
    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
예제 #5
0
 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)
예제 #6
0
 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)
예제 #7
0
파일: criterion.py 프로젝트: ru003ar/BigDL
 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
예제 #8
0
파일: image.py 프로젝트: ru003ar/BigDL
 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)
예제 #9
0
파일: image.py 프로젝트: ru003ar/BigDL
 def __init__(self, bigdl_type="float", *args):
     self.value = callBigDlFunc(
             bigdl_type, JavaValue.jvm_class_constructor(self), *args)
예제 #10
0
 def __init__(self, bigdl_type="float"):
     self.value = callZooFunc(bigdl_type,
                              JavaValue.jvm_class_constructor(self))
예제 #11
0
 def __init__(self, label_map, clses, probs, bigdl_type="float"):
     self.value = callBigDlFunc(bigdl_type,
                                JavaValue.jvm_class_constructor(self),
                                label_map, clses, probs)
예제 #12
0
 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)