Skip to content

Is there a constant initializer for params in Flax/JAX? #1061

Answered by marcvanzee
marcvanzee asked this question in Q&A
Discussion options

You must be logged in to vote

Answer by @jacobaustin123: I don't think so, but you could make your own with:

def constant(key, shape, dtype=jnp.float32, value=0.0): 
  return jnp.full(shape, value, dtype)

Replies: 1 comment

Comment options

marcvanzee
Mar 1, 2021
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by marcvanzee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant