PositionEncoder
- class opennmt.layers.PositionEncoder(*args, **kwargs)[source]
Base class for position encoders.
Inherits from:
keras.src.engine.base_layer.Layer
Extended by:
- __init__(reducer=None, **kwargs)[source]
Initializes the position encoder.
- Parameters
reducer – A
opennmt.layers.Reducer
to merge inputs and position encodings. Defaults toopennmt.layers.SumReducer
.**kwargs – Additional layer keyword arguments.