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, min, bigdl_type="float"):
"""
Create a MinLoss trigger.
:param min: min loss
"""
JavaValue.__init__(self, None, bigdl_type, min)
end_trigger,
batch_size,
optim_method=None,
cores=None,
bigdl_type="float"):
if not optim_method:
optim_methods = {model.name(): SGD()}
elif isinstance(optim_method, OptimMethod):
optim_methods = {model.name(): optim_method}
elif isinstance(optim_method, JavaObject):
optim_methods = {model.name(): OptimMethod(optim_method, bigdl_type)}
else:
optim_methods = optim_method
if cores is None:
cores = multiprocessing.cpu_count()
JavaValue.__init__(self, None, bigdl_type,
[JTensor.from_ndarray(X) for X in to_list(X)],
JTensor.from_ndarray(Y),
model.value,
criterion,
optim_methods, end_trigger, batch_size, cores)
def __init__(self, bigdl_type="float"):
JavaValue.__init__(self, None, bigdl_type)
def __init__(self, iteration_per_epoch, bigdl_type="float"):
JavaValue.__init__(self, None, bigdl_type, iteration_per_epoch)
def __init__(self, decay_step, decay_rate, stair_case=False, bigdl_type="float"):
JavaValue.__init__(self, None, bigdl_type, decay_step, decay_rate, stair_case)
def __init__(self, max, bigdl_type="float"):
"""
Create a MaxScore trigger.
:param max: max score
"""
JavaValue.__init__(self, None, bigdl_type, max)
def __init__(self, first, *other):
"""
Create a Or trigger.
:param first: first Trigger
:param other: other Trigger
"""
JavaValue.__init__(self, None, "float", first, list(other))
def __init__(self, l2, bigdl_type="float"):
JavaValue.__init__(self, None, bigdl_type, l2)
def __init__(self, k, classes, bigdl_type="float"):
JavaValue.__init__(self, None, bigdl_type, k, classes)
def __init__(self, upper=None, lower=None, bigdl_type="float"):
if upper is not None and lower is not None:
upper = upper + 0.0
lower = lower + 0.0
JavaValue.__init__(self, None, bigdl_type, upper, lower)
else:
JavaValue.__init__(self, None, bigdl_type)