Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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, 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
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)
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 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):
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=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, 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, bigdl_type="float"):
self.value = callZooFunc(
bigdl_type, JavaValue.jvm_class_constructor(self))