ReflectionPad1d#
- class brainstate.nn.ReflectionPad1d(padding, in_size=None, name=None)[source]#
Pads the input tensor using the reflection of the input boundary.
- Parameters:
Examples
>>> import brainstate as brainstate >>> import jax.numpy as jnp >>> pad = brainstate.nn.ReflectionPad1d(2) >>> input = jnp.ones((1, 5, 3)) # (batch=1, length=5, channels=3) >>> output = pad(input) >>> print(output.shape) (1, 9, 3)