DenseReducer

class opennmt.layers.DenseReducer(*args, **kwargs)[source]

A reducer that concatenates its inputs in depth and applies a linear transformation.

Inherits from: opennmt.layers.ConcatReducer

__init__(output_size, activation=None, **kwargs)[source]

Initializes the reducer.

Parameters
  • output_size – The output size of the linear transformation.

  • activation – Activation function (a callable). Set it to None to maintain a linear activation.

  • **kwargs – Additional layer arguments.

reduce(inputs)[source]

See opennmt.layers.Reducer.call().