Skip to content

Conversation

prashantkhurana
Copy link

@prashantkhurana prashantkhurana commented Mar 29, 2023

Fix lab1 assertion dense layer output assertion :

  1. tf.random.set_seed only sets the global seed https://www.tensorflow.org/api_docs/python/tf/random/set_seed

  2. we need to set keras set_random_seed to make all seeds be deterministic.

docs : https://www.tensorflow.org/api_docs/python/tf/config/experimental/enable_op_determinism, https://www.tensorflow.org/api_docs/python/tf/keras/utils/set_random_seed.enable_op_determinism might not be needed here but its good to have.

Fixes #116

@prashantkhurana prashantkhurana changed the title Fix lab1 assertion dense layer output assertion Fix lab1 dense layer output assertion Mar 29, 2023
1) tf.random.set_seed only sets the global seed https://www.tensorflow.org/api_docs/python/tf/random/set_seed
2) we need to set keras set_random_seed to make all seeds be deterministic. docs : https://www.tensorflow.org/api_docs/python/tf/config/experimental/enable_op_determinism, https://www.tensorflow.org/api_docs/python/tf/keras/utils/set_random_seed.

enable_op_determinism might not be needed here but its good to have.

fixes MITDeepLearning#116
Copy link

@jacobhq jacobhq left a comment

Choose a reason for hiding this comment

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

Thanks, this worked for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lab1, Part1: Assertion fails
4 participants