How to use the bigdl.util.common.JavaValue.jvm_class_constructor function in bigdl

To help you get started, we’ve selected a few bigdl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github intel-analytics / analytics-zoo / models / src / main / python / bigdl / zoo / models.py View on Github external
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))
github intel-analytics / analytics-zoo / transform / vision / src / main / python / transform / vision / image.py View on Github external
def __init__(self, image_list=None, label_list=None, jvalue=None, bigdl_type="float"):
        assert jvalue or image_list, "jvalue and image_list cannot be None in the same time"
        if jvalue:
            self.value = jvalue
        else:
            # init from image ndarray list and label rdd(optional)
            image_tensor_list = image_list.map(lambda image: JTensor.from_ndarray(image))
            label_tensor_list = label_list.map(lambda label: JTensor.from_ndarray(label)) if label_list else None
            self.value = callBigDlFunc(bigdl_type, JavaValue.jvm_class_constructor(self),
                                       image_tensor_list, label_tensor_list)

        self.bigdl_type = bigdl_type
github intel-analytics / analytics-zoo / pyzoo / zoo / models / image / objectdetection / object_detector.py View on Github external
def __init__(self, label_map, thresh=0.3, encoding="png",
                 bigdl_type="float"):
        self.value = callZooFunc(
            bigdl_type, JavaValue.jvm_class_constructor(self), label_map, thresh, encoding)
github intel-analytics / BigDL / pyspark / bigdl / transform / vision / image.py View on Github external
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
github intel-analytics / analytics-zoo / models / src / main / python / bigdl / zoo / models.py View on Github external
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)
github intel-analytics / BigDL / pyspark / bigdl / nn / layer.py View on Github external
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
github intel-analytics / BigDL / pyspark / bigdl / transform / vision / image.py View on Github external
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)
github intel-analytics / analytics-zoo / transform / vision / src / main / python / transform / vision / image.py View on Github external
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
github intel-analytics / analytics-zoo / pyzoo / zoo / models / image / common / image_config.py View on Github external
def __init__(self, bigdl_type="float"):
        self.value = callZooFunc(
            bigdl_type, JavaValue.jvm_class_constructor(self))