Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Enhanced the random seed generation function. #328

Merged
merged 9 commits into from
Jul 3, 2019

Conversation

eaplatanios
Copy link
Contributor

@eaplatanios eaplatanios commented Jul 2, 2019

This PR enhances the function that generates default random seeds for TensorFlow. This is needed because the previous approach is weak in multi-process settings, which are quite common when training or evaluating machine learning models. The implementation is inspired from OpenAI Gym.

I also added an implementation on SHA512 in the utilities to avoid having any external library dependencies along with a test for the hash function. The SHA512 implementation is based on that of CryptoSwift.

@eaplatanios
Copy link
Contributor Author

All the requested changes (except for the fileprivate for the bytes(count:startingAt:) function are done.

@eaplatanios
Copy link
Contributor Author

This should be ready for another look now.

hashCopy[4].rotate(rightBy: 41)
let ch = (hashCopy[4] & hashCopy[5]) ^ ((~hashCopy[4]) & hashCopy[6])
let t1 = hashCopy[7] &+ s1 &+ ch &+ k[j] &+ UInt64(M[j])
hashCopy[7] = hashCopy[6]
Copy link
Contributor

Choose a reason for hiding this comment

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

@stephentyrone Could you please advise?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found this which seems relevant. :)

@eaplatanios eaplatanios merged commit b698f1f into tensorflow:master Jul 3, 2019
@Shashi456
Copy link
Contributor

@eaplatanios, If you need any help with all these tasks you are undertaking, I'd love to help you out. I really like the enhancements we've had in the past week. So if there are trivial/non-trivial tasks you need some help with, do tag me.

@eaplatanios
Copy link
Contributor Author

@Shashi456 Thanks a lot! Sorry for the late response but I was traveling. I don't have something planned right now, but I will definitely tag you if anything comes up. :)

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

Successfully merging this pull request may close these issues.

4 participants