question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Examples for traverse_util module

See original GitHub issue

First off, loving the new linen api 🎉!!!

The traverse_util module looks useful for manipulating parameters/state, but I could not figure out how to use it effectively (apart from unflatten_dict and flatten_dict, which are both extremely useful). The simple examples in the docs make sense, but it’d be nice to see how to use this in a real setting. Perhaps the power of this module can be illustrated in a transfer learning example, where you need to manipulate subsets of parameters?

The module seems similar to Haiku’s data_structures module, but the API seems more complex.

Also, it’s unfortunate that Flax has jax_utils (plural) and traverse_util (singular). Is it too late to pluralize traverse_util for consistency?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
marcvanzeecommented, Jan 31, 2022

Yes, but maybe we should create a new one for removing the traverse_util API. Since you started this issue as well, do you want to do that?

0reactions
n2cholascommented, Jan 31, 2022

Got it, I agree that it makes sense to remove this API altogether. I think the equivalent tree_map code is easier to understand as well. In this case, should I close this issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

flax.traverse_util package - Read the Docs
flax.traverse_util package#. A utility for traversing immutable datastructures. A Traversal can be used to iterate and update complex data structures.
Read more >
Top 5 @babel/traverse Code Examples - Snyk
To help you get started, we've selected a few @babel/traverse examples, based on popular ways it is used in public projects.
Read more >
A dive into the Node.js 'Util' module | Three Five Two | Medium
util.debuglog provides a simple logging function that is explicitly enabled using the NODE_DEBUG environment variable. Here's a quick example…
Read more >
traverse JavaScript and Node.js code examples - Tabnine
Best JavaScript code snippets using traverse(Showing top 15 results out of 1,179) · utils/obfuscate.js/withKeepStartCount · configloader.js/traverse. · benchmark/ ...
Read more >
JavaScript general utility module example
1.11 - traverse an object ... On top of deep cloning another useful object method to have is something that can be used...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found