optax.stateless#
- optax.stateless(f: Callable[[Array | ndarray | bool | number | bool | int | float | complex | Iterable[Array | ndarray | bool | number | bool | int | float | complex | Iterable[ArrayTree] | Mapping[Any, ArrayTree]] | Mapping[Any, Array | ndarray | bool | number | bool | int | float | complex | Iterable[ArrayTree] | Mapping[Any, ArrayTree]], Array | ndarray | bool | number | bool | int | float | complex | Iterable[Array | ndarray | bool | number | bool | int | float | complex | Iterable[ArrayTree] | Mapping[Any, ArrayTree]] | Mapping[Any, Array | ndarray | bool | number | bool | int | float | complex | Iterable[ArrayTree] | Mapping[Any, ArrayTree]] | None], Array | ndarray | bool | number | bool | int | float | complex | Iterable[Array | ndarray | bool | number | bool | int | float | complex | Iterable[ArrayTree] | Mapping[Any, ArrayTree]] | Mapping[Any, Array | ndarray | bool | number | bool | int | float | complex | Iterable[ArrayTree] | Mapping[Any, ArrayTree]]]) GradientTransformation[source]#
Creates a stateless transformation from an update-like function.
This wrapper eliminates the boilerplate needed to create a transformation that does not require saved state between iterations.
- Parameters:
f โ Update function that takes in updates (e.g. gradients) and parameters and returns updates. The parameters may be None.
- Returns: