Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Shape Inference + Module Hooks (compact) #16

Merged
merged 22 commits into from
Oct 29, 2021
Merged

Shape Inference + Module Hooks (compact) #16

merged 22 commits into from
Oct 29, 2021

Conversation

cgarciae
Copy link
Owner

@cgarciae cgarciae commented Oct 26, 2021

Changes

  • Adds the tx.next_key() function and the tx.rng_key() context manager.
  • Module.init new has the following behavior:
    • Accepts an optional inputs argument and runs the forward method if given.
    • Set the given key in the context so tx.next_key() can be used.
    • Accepts a call_method: str which defines the method to call, "__call__" used by default.
  • Modules will now be initialized if constructed within @tx.compact functions when called by init.
  • Adds @tx.compact_module decorator that can turn any function into a Module with a compact __call__ as the decorated function.
  • New Crossentropy loss that generalizes BinaryCrossentropy, CategoricalCrossentropy and SparseCategoricalCrossentropy.
  • New Flatten layers.

@cgarciae cgarciae changed the title [WIP] Shape Inference + Module Hooks (compact) Shape Inference + Module Hooks (compact) Oct 28, 2021
@cgarciae cgarciae merged commit daff4a1 into master Oct 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant