Repository navigation
add JEPA example - #5660
Open
linjing-lab wants to merge 1 commit into
Open
add JEPA example#5660linjing-lab wants to merge 1 commit into
linjing-lab wants to merge 1 commit into
Conversation
linjing-lab
commented
Nov 23, 2026
linjing-lab
left a comment
Author
There was a problem hiding this comment.
Check all files related to JEPA example.
linjing-lab
commented
Nov 23, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds
examples/jepa/, a temporal Joint-Embedding Predictive Architecture (JEPA) example built with Flax Linen. It trains an online encoder and predictor against an EMA (momentum) target encoder with a variance regularizer that prevents representation collapse, and reports a linear-probe R² comparison between the trained representation, a random-init representation and the raw last frame. The pedagogical point is how a LinenModulecombines with raw JAX transformations:jax.flatten_util.ravel_pytreeflattens the parameter PyTree into a vector sojit,value_and_grad,hessianandlax.while_loopcan drive a hand-written damped BFGS solver with an analytic initial Hessian, Wolfe line search and BFGS rank-2 update, while Flax owns model definition and initialization (xavier_normal/zeros) andto_variables/to_paramsconvert back to standard Flax variables / params PyTrees for use withTrainState+ Optax. The example is split intobase.py(MLP and_init_mlp),bfgs.py(make_bfgs),data.py(make_series),eval.py(linear_probe) andmain.py(JEPA,gen_jepa,train_jepaand the__main__demo).Checklist