Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get different values when run Ex2_LinearRegression.java in many times #1012

Open
bewithme opened this issue Dec 1, 2020 · 1 comment
Open

Comments

@bewithme
Copy link

bewithme commented Dec 1, 2020

Issue Description

Please describe your issue, along with:

in this example https://github.com/eclipse/deeplearning4j-examples/blob/master/samediff-examples/src/main/java/org/nd4j/examples/samediff/quickstart/basics/Ex2_LinearRegression.java why gradMap.get("weights") and gradMap.get("bias") return me different value when I run it in many times ?

  • expected gradMap.get("weights") and gradMap.get("bias") return the same values when run it in many times
  • encountered gradMap.get("weights") and gradMap.get("bias") return me different values when run it in many times

Version Information

Please indicate relevant versions, including, if relevant:

  • Deeplearning4j version: beta7
  • platform information (OS, etc): mac OS10.15.6
  • CUDA version, if used: None
  • NVIDIA driver version, if in use: None
@treo
Copy link
Member

treo commented Dec 1, 2020

What you are seeing is just the effect of no fixed random seed. The weights get initialized randomly on each run of the example, you get different gradients on each run.

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

No branches or pull requests

2 participants