Stateless Transformation
See original GitHub issueRight now, there’s some boilerplate for defining simple gradient transformations. If a user wants to implement custom weight decay, clipping, constraints, etc without any state, they still have to define a nested function with an init
that does nothing, and handle the empty state.
I think it’d be convenient to provide a stateless
transformation that accepts a function to apply to the updates and params. We can also do the jax.tree_multimap
for the user by default.
weight_decay = optax.stateless(lambda g, p: g + 0.1 * p)
If the user wants to define a function that does the tree_multimap themselves:
def my_function(updates, params):
return jax.tree_multimap(lambda g, p: ..., updates, params)
optim = optax.stateless(my_function, on_leaves=False)
In my view, this is a very clean way to implement simple stateless transformations. I think the on_leaves
argument could use a better name, though. I’d be happy to implement this if it sounds reasonable.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Stateful/stateless transformations - Big Data Analytics with ...
In a stateless transformation, whether or not each microbatch of data is processed does not depend on the previous data batches, so each...
Read more >Stateful/stateless transformations | Scala and Spark for Big ...
In Stateless transformations, the processing of each micro-batch of data does not depend on the previous batches of data. Thus, this is a...
Read more >Stateless Transforms - Hazelcast Jet
Stateless transforms are the bread and butter of a data pipeline: they transform the input into the correct shape that is required by...
Read more >7.6 Spark Streaming Tutorial | Stateless vs Stateful ... - YouTube
Then we will see how stateful and stateless transformations are done in spark streaming. how these are useful After completing the Apache ...
Read more >DS320.33 Spark Streaming: Stateless Transformations
#DataStaxAcademy #DS320 DS320.33 Spark Streaming: Stateless Transformations In this course, you will learn how to effectively and ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No more action needed on your side @mtthss, I’ll work on this over the weekend!
Great, thanks @n2cholas! And apologies for the slow turnaround on this issue.