Keraflow
Deep Learning for Python.
 All Classes Namespaces Functions Pages
keraflow.layers.core.Lambda Class Reference

Wrapper for implementating simple inline layer. More...

Inheritance diagram for keraflow.layers.core.Lambda:

Public Member Functions

def __init__
 

Detailed Description

Wrapper for implementating simple inline layer.

  • input_shapes: nD, (nb_samples, x, y, ...)
  • output_shape: nD, specified by output_shape argument.

Examples

```python

add a x -> x^2 layer

model.add(Lambda(lambda x, factor: x ** 2)) ```

Constructor & Destructor Documentation

def keraflow.layers.core.Lambda.__init__ (   self,
  output_fn,
  output_shape_fn = None,
  arguments = {},
  kwargs 
)
Parameters
output_fnThe function to transform input tensor into output tensor. The function should take 1 position argument (the input tensor) and variable numbers of keyword argument whose value are specified by arguments argument.
output_shape_fntuple, list, or (lambda) function. Expected output shape.
  1. If a tuple or list, it should specifies all dimension excepts for the batch dimension.
  2. If a function, it should accept the input_shape (tuple) and return an output_shape (tuple), such that both input_shape and output_shape includes the batch dimension.
argumentsdict. Optional keyword arguments to be passed to output_fn.
kwargssee Layer.__init__.