deeplearning4j-examples
deeplearning4j-examples copied to clipboard
get different values when run Ex2_LinearRegression.java in many times
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
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.