Class Lambda
Wraps arbitrary expression as a Layer object.
Implements
Inherited Members
Namespace: Keras.Layers
Assembly: Keras.dll
Syntax
public class Lambda : BaseLayer, IDisposable
Constructors
| Improve this Doc View SourceLambda(Object, Shape, NDarray, Dictionary<String, Object>, Shape)
Initializes a new instance of the Lambda class.
Declaration
public Lambda(object function, Shape output_shape = null, NDarray mask = null, Dictionary<string, object> arguments = null, Shape input_shape = null)
Parameters
Type | Name | Description |
---|---|---|
System.Object | function | The function to be evaluated. Takes input tensor or list of tensors as first argument. |
Shape | output_shape | Expected output shape from function. Only relevant when using Theano. Can be a tuple or function. If a tuple, it only specifies the first dimension onward; sample dimension is assumed either the same as the input: output_shape = (input_shape[0], ) + output_shape or, the input is None and the sample dimension is also None: output_shape = (None, ) + output_shape If a function, it specifies the entire shape as a function of the input shape: output_shape = f(input_shape) |
Numpy.NDarray | mask | Either None (indicating no masking) or a Tensor indicating the input mask for Embedding. |
System.Collections.Generic.Dictionary<System.String, System.Object> | arguments | optional dictionary of keyword arguments to be passed to the function. |
Shape | 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. |