Skip to content

Comments

[tmva][sofie] Fix Keras BinaryOp test model shapes and improve reproducibility#20875

Open
Shlok-Saxena wants to merge 1 commit intoroot-project:masterfrom
Shlok-Saxena:sofie-keras-binaryop-shape-seed
Open

[tmva][sofie] Fix Keras BinaryOp test model shapes and improve reproducibility#20875
Shlok-Saxena wants to merge 1 commit intoroot-project:masterfrom
Shlok-Saxena:sofie-keras-binaryop-shape-seed

Conversation

@Shlok-Saxena
Copy link
Contributor

This Pull request

Fixes a shape mismatch in the Keras test model generator used for SOFIE tests and improves reproducibility of generated models.

Changes or fixes:

  • Fixed incorrect training input/target tensor shapes in generateBinaryOpModel() from (2,1) to (2,2) to match the model input signature Input(shape=(2,))
  • Added tf.keras.utils.set_random_seed(0) so model initialization and generated outputs are reproducible across runs, improving stability of SOFIE Keras parser tests.

Checklist:

  • tested changes locally
  • updated the docs (if necessary)

Copy link
Collaborator

@sanjibansg sanjibansg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Shlok-Saxena ,
Thanks for your PR. I have one comment.

Comment on lines +122 to +124
x1_train = randomGenerator.rand(2,2)
x2_train = randomGenerator.rand(2,2)
y_train = randomGenerator.rand(2,2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably I am missing something, but why do we need this change? The input asks for tensors of shape (2,) which should work fine with inputs shaped (2,1) right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants