Skip to content
Discussion options

You must be logged in to vote

Hi @1000001111,
Keras uses the build() function to defer the initialization of components until the input shapes are fully known—for example, weight matrix dimensions depend on the output of the previous layer. You’re right that in this case, the input shapes aren’t actually used, so the same logic could be implemented directly in __init__().

Replies: 1 comment

Comment options

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