Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
bias_regularizer=None,
init_weight=None,
init_bias=None,
init_grad_weight=None,
init_grad_bias=None,
bigdl_type="float"):
super(TemporalConvolution, self).__init__(None, bigdl_type,
input_frame_size,
output_frame_size,
kernel_w,
stride_w,
propagate_back,
weight_regularizer,
bias_regularizer,
JTensor.from_ndarray(init_weight),
JTensor.from_ndarray(init_bias),
JTensor.from_ndarray(init_grad_weight),
JTensor.from_ndarray(init_grad_bias))
def set_init_method(self, weight_init_method = None, bias_init_method = None):
def __init__(self,
n_input_plane=1,
kernel=None,
threshold=1e-4,
thresval=1e-4,
bigdl_type="float"):
super(SpatialDivisiveNormalization, self).__init__(None, bigdl_type,
n_input_plane,
JTensor.from_ndarray(kernel),
threshold,
thresval)
with_bias=True,
bigdl_type="float"):
super(SpatialShareConvolution, self).__init__(None, bigdl_type,
n_input_plane,
n_output_plane,
kernel_w,
kernel_h,
stride_w,
stride_h,
pad_w,
pad_h,
n_group,
propagate_back,
wRegularizer,
bRegularizer,
JTensor.from_ndarray(init_weight),
JTensor.from_ndarray(init_bias),
JTensor.from_ndarray(init_grad_weight),
JTensor.from_ndarray(init_grad_bias),
with_bias)
def set_init_method(self, weight_init_method = None, bias_init_method = None):
def __init__(self, value, bigdl_type="float"):
super(Constant, self).__init__(None, bigdl_type, JTensor.from_ndarray(value))
The layer does not have weight/bias
>>> add = Add(2)
creating: createAdd
>>> try:
... add.set_weights([np.array([7,8]), np.array([1,2])])
... except Py4JJavaError as err:
... print(err.java_exception)
...
java.lang.IllegalArgumentException: requirement failed: the number of input weight/bias is not consistant with number of weight/bias of this layer
>>> cAdd = CAdd([4, 1])
creating: createCAdd
>>> cAdd.set_weights(np.ones([4, 1]))
>>> (cAdd.get_weights()[0] == np.ones([4, 1])).all()
True
"""
tensors = [JTensor.from_ndarray(param, self.bigdl_type) for param in to_list(weights)]
callBigDlFunc(self.bigdl_type, "setWeights", self.value, tensors)
def __init__(self,
n_input_plane=1,
kernel=None,
bigdl_type="float"):
super(SpatialSubtractiveNormalization, self).__init__(None, bigdl_type,
n_input_plane,
JTensor.from_ndarray(kernel))
def __init__(self,
weights=None,
size_average=True,
logProbAsInput=True,
bigdl_type="float"):
super(ClassNLLCriterion, self).__init__(None, bigdl_type,
JTensor.from_ndarray(weights),
size_average, logProbAsInput)
def __init__(self, input_size, output_size, with_bias=True, wRegularizer=None, bRegularizer=None,
init_weight=None, init_bias=None, init_grad_weight=None, init_grad_bias=None, bigdl_type="float"):
super(Linear, self).__init__(None, bigdl_type, input_size, output_size,
with_bias, wRegularizer, bRegularizer,
JTensor.from_ndarray(init_weight),
JTensor.from_ndarray(init_bias),
JTensor.from_ndarray(init_grad_weight),
JTensor.from_ndarray(init_grad_bias))