zoo.pipeline.api package¶
Subpackages¶
- zoo.pipeline.api.keras package
- Subpackages
- zoo.pipeline.api.keras.datasets package
- zoo.pipeline.api.keras.engine package
- zoo.pipeline.api.keras.layers package
- Submodules
- zoo.pipeline.api.keras.layers.advanced_activations module
- zoo.pipeline.api.keras.layers.convolutional module
- zoo.pipeline.api.keras.layers.convolutional_recurrent module
- zoo.pipeline.api.keras.layers.core module
- zoo.pipeline.api.keras.layers.embeddings module
- zoo.pipeline.api.keras.layers.local module
- zoo.pipeline.api.keras.layers.noise module
- zoo.pipeline.api.keras.layers.normalization module
- zoo.pipeline.api.keras.layers.pooling module
- zoo.pipeline.api.keras.layers.recurrent module
- zoo.pipeline.api.keras.layers.self_attention module
- zoo.pipeline.api.keras.layers.torch module
- zoo.pipeline.api.keras.layers.wrappers module
- Module contents
- Submodules
- zoo.pipeline.api.keras.base module
- zoo.pipeline.api.keras.metrics module
- zoo.pipeline.api.keras.models module
- zoo.pipeline.api.keras.objectives module
- zoo.pipeline.api.keras.optimizers module
- zoo.pipeline.api.keras.regularizers module
- zoo.pipeline.api.keras.utils module
- Module contents
- Subpackages
- zoo.pipeline.api.keras2 package
- Subpackages
- zoo.pipeline.api.keras2.engine package
- zoo.pipeline.api.keras2.layers package
- Submodules
- zoo.pipeline.api.keras2.layers.advanced_activations module
- zoo.pipeline.api.keras2.layers.convolutional module
- zoo.pipeline.api.keras2.layers.convolutional_recurrent module
- zoo.pipeline.api.keras2.layers.core module
- zoo.pipeline.api.keras2.layers.embeddings module
- zoo.pipeline.api.keras2.layers.local module
- zoo.pipeline.api.keras2.layers.merge module
- zoo.pipeline.api.keras2.layers.noise module
- zoo.pipeline.api.keras2.layers.normalization module
- zoo.pipeline.api.keras2.layers.pooling module
- zoo.pipeline.api.keras2.layers.recurrent module
- zoo.pipeline.api.keras2.layers.wrappers module
- Module contents
- Submodules
- zoo.pipeline.api.keras2.base module
- Module contents
- Subpackages
- zoo.pipeline.api.net package
- zoo.pipeline.api.onnx package
- Subpackages
- zoo.pipeline.api.onnx.mapper package
- Submodules
- zoo.pipeline.api.onnx.mapper.abs module
- zoo.pipeline.api.onnx.mapper.add module
- zoo.pipeline.api.onnx.mapper.averagepool module
- zoo.pipeline.api.onnx.mapper.batchnormalization module
- zoo.pipeline.api.onnx.mapper.cast module
- zoo.pipeline.api.onnx.mapper.clip module
- zoo.pipeline.api.onnx.mapper.concat module
- zoo.pipeline.api.onnx.mapper.constant module
- zoo.pipeline.api.onnx.mapper.conv module
- zoo.pipeline.api.onnx.mapper.div module
- zoo.pipeline.api.onnx.mapper.dropout module
- zoo.pipeline.api.onnx.mapper.elu module
- zoo.pipeline.api.onnx.mapper.exp module
- zoo.pipeline.api.onnx.mapper.flatten module
- zoo.pipeline.api.onnx.mapper.gather module
- zoo.pipeline.api.onnx.mapper.gemm module
- zoo.pipeline.api.onnx.mapper.globalaveragepool module
- zoo.pipeline.api.onnx.mapper.greater module
- zoo.pipeline.api.onnx.mapper.hardsigmoid module
- zoo.pipeline.api.onnx.mapper.leakyrelu module
- zoo.pipeline.api.onnx.mapper.log module
- zoo.pipeline.api.onnx.mapper.logsoftmax module
- zoo.pipeline.api.onnx.mapper.lrn module
- zoo.pipeline.api.onnx.mapper.matmul module
- zoo.pipeline.api.onnx.mapper.maxpool module
- zoo.pipeline.api.onnx.mapper.mul module
- zoo.pipeline.api.onnx.mapper.neg module
- zoo.pipeline.api.onnx.mapper.operator_mapper module
- zoo.pipeline.api.onnx.mapper.pow module
- zoo.pipeline.api.onnx.mapper.reducemean module
- zoo.pipeline.api.onnx.mapper.reducesum module
- zoo.pipeline.api.onnx.mapper.relu module
- zoo.pipeline.api.onnx.mapper.reshape module
- zoo.pipeline.api.onnx.mapper.shape module
- zoo.pipeline.api.onnx.mapper.sigmoid module
- zoo.pipeline.api.onnx.mapper.slice module
- zoo.pipeline.api.onnx.mapper.softmax module
- zoo.pipeline.api.onnx.mapper.sqrt module
- zoo.pipeline.api.onnx.mapper.squeeze module
- zoo.pipeline.api.onnx.mapper.sub module
- zoo.pipeline.api.onnx.mapper.tanh module
- zoo.pipeline.api.onnx.mapper.transpose module
- zoo.pipeline.api.onnx.mapper.unsqueeze module
- Module contents
- zoo.pipeline.api.onnx.mapper package
- Submodules
- zoo.pipeline.api.onnx.onnx_helper module
- zoo.pipeline.api.onnx.onnx_loader module
- Module contents
- Subpackages
- zoo.pipeline.api.torch package
Submodules¶
zoo.pipeline.api.autograd module¶
-
class
zoo.pipeline.api.autograd.Constant(data, name=None, bigdl_type='float')[source]¶ Bases:
zoo.pipeline.api.keras.base.ZooKerasCreator,zoo.pipeline.api.autograd.VariableOperatorA constant Variable without weights. :param data: value of the Variable. :param name: Optional. Name of the Variable
-
class
zoo.pipeline.api.autograd.CustomLoss(loss_func, y_pred_shape, y_true_shape=None)[source]¶ Bases:
zoo.pipeline.api.keras.objectives.LossFunction-
backward(y_true, y_pred)[source]¶ NB: It’s for debug only, please use optimizer.optimize() in production. Performs a back-propagation step through the criterion, with respect to the given input.
Parameters: - input – ndarray or list of ndarray
- target – ndarray or list of ndarray
Returns: ndarray
-
forward(y_true, y_pred)[source]¶ NB: It’s for debug only, please use optimizer.optimize() in production. Takes an input object, and computes the corresponding loss of the criterion, compared with target
Parameters: - input – ndarray or list of ndarray
- target – ndarray or list of ndarray
Returns: value of loss
-
-
class
zoo.pipeline.api.autograd.Lambda(function, input_shape=None, bigdl_type='float')[source]¶ Bases:
zoo.pipeline.api.keras.base.ZooKerasCreatorUsed for evaluating an arbitrary expressions on an input.
# Examples
``` # Arguments
- function: The function to be evaluated.
- Takes input tensor as first argument.
- # Input shape
- Arbitrary. Use the keyword argument input_shape (tuple of integers, does not include the samples axis) when using this layer as the first layer in a model.
-
class
zoo.pipeline.api.autograd.LambdaLayer(input_vars, out_var, input_shape=None, **kwargs)[source]¶
-
class
zoo.pipeline.api.autograd.Parameter(shape, init_method=None, init_weight=None, trainable=True, **kwargs)[source]¶ Bases:
zoo.pipeline.api.keras.base.ZooKerasLayer,zoo.pipeline.api.autograd.VariableOperatorA trainable Variable. The default init_method is RandomUniform(-0.05, 0.05). You can also specify the init_weight by passing a ndarray. :param shape: Shape of this Parameter :param init_method: A method used to initialize the Parameter.
The default value is RandomUniform(-0.05, 0.05)Parameters: init_weight – A ndarray as the init value. :param trainable It’s true by default, meaning the value would be updated by gradient.
-
shape¶
-
-
class
zoo.pipeline.api.autograd.Variable(input_shape, node=None, jvalue=None, name=None)[source]¶ Bases:
zoo.pipeline.api.keras.base.ZooKerasCreator,zoo.pipeline.api.autograd.VariableOperator-
node¶
-
-
class
zoo.pipeline.api.autograd.VariableOperator[source]¶ Bases:
object-
index_select(dim, index)[source]¶ - Select an index of the input in the given dim and return the subset part. The batch dimension needs to be unchanged. The selected dim would be remove after this operation. For example, if input is: 1 2 3 4 5 6 Select(1, 1) will give output [2 5] Select(1, -1) will give output [3 6]
Parameters: - dim – The dimension to select. 0-based index. Cannot select the batch dimension. -1 means the last dimension of the input.
- index – The index of the dimension to be selected. 0-based index. -1 means the last dimension of the input.
Returns:
-
shape¶
-
slice(dim, start_index, length)[source]¶ Same as narrow in Torch. Slice the input with the number of dimensions not being reduced. The batch dimension needs to be unchanged. For example, if input is: 1 2 3 4 5 6 slice(1, 1, 2) will give output 2 3 5 6 slice(1, 2, -1) will give output 3 6 :param dim The dimension to narrow. 0-based index. Cannot narrow the batch dimension.
-1 means the last dimension of the input.- :param startIndex Non-negative integer.
- The start index on the given dimension. 0-based index.
:param length The length to be sliced. Default is 1.
-
-
zoo.pipeline.api.autograd.abs(x)[source]¶ Element-wise absolute value. :param x: A variable. :return: A variable.
-
zoo.pipeline.api.autograd.batch_dot(x, y, axes=1, normalize=False)[source]¶ Operator that computes a dot product between samples in two tensors.
E.g. if applied to two tensors a and b of shape (batch_size, n), the output will be a tensor of shape (batch_size, 1) where each entry i will be the dot product between a[i] and b[i].
Parameters: - x – Shape should only be [batch, xx]
- y – Shape should only be [batch, xx]
- axes – Integer or tuple of integers, axis or axes along which to take the dot product.
- normalize – Whether to L2-normalize samples along the dot product axis before taking the dot product. If set to True, then the output of the dot product is the cosine proximity between the two samples.
Returns: A variable.
-
zoo.pipeline.api.autograd.clip(x, min, max)[source]¶ Element-wise value clipping. :param x: A variable. :param min: Python float or integer. :param max: Python float or integer. :return: A variable.
-
zoo.pipeline.api.autograd.contiguous(x)[source]¶ Turn the output and grad to be contiguous for the input Variable :param x: A variable.
-
zoo.pipeline.api.autograd.epsilon()[source]¶ Define the value of epsilon. :return: A value of type Double.
-
zoo.pipeline.api.autograd.erf(x)[source]¶ Computes the error function(Gauss error function) of each element. :param x: A variable. :return: A variable.
-
zoo.pipeline.api.autograd.exp(x)[source]¶ Element-wise exponential. :param x: A variable. :return: A variable.
-
zoo.pipeline.api.autograd.expand_dims(x, axis)[source]¶ - Adds a 1-sized dimension at index “axis”.
param x: a Variable to be expanded param axis: axis Position where to add a new axis. The axis is 0 based and if you set the axis to 0, you would change the batch dim.
-
zoo.pipeline.api.autograd.l2_normalize(x, axis)[source]¶ Normalizes a tensor wrt the L2 norm alongside the specified axis. :param x: A variable. Shape should only be [batch, xx] :param axis: axis along which to perform normalization. :return: A variable.
-
zoo.pipeline.api.autograd.log(x)[source]¶ Element-wise log. :param x: A variable. :return: A variable.
-
zoo.pipeline.api.autograd.maximum(x, y)[source]¶ Element-wise maximum of two variables. :param x: A variable. :param y: A variable. :return: A variable.
-
zoo.pipeline.api.autograd.mean(x, axis=0, keepDims=False)[source]¶ Mean of a variable, alongside the specified axis. :param x: A variable. :param axis: A list of integer. Axes to compute the mean. :param keepDims: A boolean, whether to keep the dimensions or not.
If keepDims is False, the rank of the variable is reduced by 1 for each entry in axis. If keepDims is True, the reduced dimensions are retained with length 1.Returns: A variable with the mean of elements of x.
-
zoo.pipeline.api.autograd.mm(x, y, axes=None)[source]¶ Module to perform matrix multiplication on two mini-batch inputs, producing a mini-batch. :param x: A variable. :param y: A variable. :param axes: Axes along which to perform multiplication. :return: A variable.
-
zoo.pipeline.api.autograd.neg(x)[source]¶ Computes numerical negative value element-wise. :param x: A variable. :return: A variable.
-
zoo.pipeline.api.autograd.pow(x, a)[source]¶ Element-wise exponentiation. :param x: A variable. :param a: Python integer. :return: A variable.
-
zoo.pipeline.api.autograd.softplus(x)[source]¶ Softplus of a variable. :param x: A variable. :return: A variable.
-
zoo.pipeline.api.autograd.softsign(x)[source]¶ Softsign of a variable. :param x: A variable. :return: A variable.
-
zoo.pipeline.api.autograd.sqrt(x)[source]¶ Element-wise square root. :param x: A variable. :return: A variable.
-
zoo.pipeline.api.autograd.square(x)[source]¶ Element-wise square. :param x: A variable. :return: A variable.
-
zoo.pipeline.api.autograd.stack(inputs, axis=1)[source]¶ Stacks a list of rank R tensors into a rank R+1 tensor. You should start from 1 as dim 0 is for batch. :param inputs: List of variables (tensors). :param axis: axis along which to perform stacking. :return:
-
zoo.pipeline.api.autograd.sum(x, axis=0, keepDims=False)[source]¶ Sum of the values in a a variable, alongside the specified axis. :param x: A variable. :param axis: An integer. Axes to compute the sum over. :param keepDims: A boolean, whether to keep the dimensions or not.
If keepDims is False, the rank of the variable is reduced by 1 for each entry in axis. If keepDims is True, the reduced dimensions are retained with length 1.Returns: A variable with sum of x.