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

SameDiff weight init is not deterministic #8248

Closed
orausch opened this issue Sep 19, 2019 · 3 comments · Fixed by KonduitAI/deeplearning4j#12
Closed

SameDiff weight init is not deterministic #8248

orausch opened this issue Sep 19, 2019 · 3 comments · Fixed by KonduitAI/deeplearning4j#12
Assignees
Labels

Comments

@orausch
Copy link

@orausch orausch commented Sep 19, 2019

Issue Description

The following test fails:

    @Test
    public void testSamediff() {

      SameDiff sd0 = SameDiff.create();
      SameDiff sd1 = SameDiff.create();
      Nd4j.getRandom().setSeed(0);

      SDVariable rand0 = sd0.var("random", new UniformInitScheme('c', 3), DataType.FLOAT, 3, 1);

      Nd4j.getRandom().setSeed(0);
      SDVariable rand1 = sd1.var("random", new UniformInitScheme('c', 3), DataType.FLOAT, 3, 1);


      Nd4j.getRandom().setSeed(0);
      System.out.println(rand0.eval());

      Nd4j.getRandom().setSeed(0);
      System.out.println(rand1.eval());

      assertTrue(rand0.eval().equalsWithEps( rand1.eval() , 0.0001));
    }

Version Information

  • Deeplearning4j version: beta5
  • Platform information: Ubuntu 18.04.3 LTS
@AlexDBlack AlexDBlack self-assigned this Oct 24, 2019
AlexDBlack added a commit to KonduitAI/deeplearning4j that referenced this issue Oct 24, 2019
… for more predictable behaviour

Signed-off-by: AlexDBlack <blacka101@gmail.com>
AlexDBlack added a commit to KonduitAI/deeplearning4j that referenced this issue Oct 24, 2019
… for more predictable behaviour

Signed-off-by: AlexDBlack <blacka101@gmail.com>
AlexDBlack added a commit to KonduitAI/deeplearning4j that referenced this issue Oct 25, 2019
… for more predictable behaviour

Signed-off-by: AlexDBlack <blacka101@gmail.com>
AlexDBlack added a commit to KonduitAI/deeplearning4j that referenced this issue Oct 26, 2019
* eclipse#8160 Remove resolvePrepertiesFromSameDiffBeforeExecution

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* SameDiff API cleanup

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* More SameDiff cleanup

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Small fixes

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* eclipse#8248 Switch SameDiff variable init from lazy to creation time for more predictable behaviour

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* eclipse#8252 TanhDerivative javadoc

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* eclipse#8225 Deconvolution2D input validation

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* eclipse#8265 Switch SameDiff.outputs() to user settable, instead of unreliable 'best guess'

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* eclipse#8224 SameDiff.zero and .one create constants, not variables

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* More cleanup and fixes

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Small test fix

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Small fix

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* DL4J SameDiff fixes

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Re-add hack for Deconvolution2DLayer until eclipse#8315 is resolved

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* eclipse#8270 Move CUDA device/version logging to Java; can be disabled via existing org.nd4j.log.initialization system property

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* All ND4J init logging checks system property

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Small tweak

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Remove redundant device logging

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* One more fix

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* UX improvements

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Deconv fix

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Add deconv tests

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Cleanup

Signed-off-by: AlexDBlack <blacka101@gmail.com>

* Remove debug code

Signed-off-by: AlexDBlack <blacka101@gmail.com>
@AlexDBlack

This comment has been minimized.

Copy link
Contributor

@AlexDBlack AlexDBlack commented Oct 26, 2019

Thanks for reporting this. Fixed here: KonduitAI#12
This will be merged back to the Eclipse repo shortly, and the fix will be available on snapshots some time next week.

@orausch

This comment has been minimized.

Copy link
Author

@orausch orausch commented Oct 27, 2019

Will you backport this to beta5? If not, is there another release upcoming that fixes this?

@AlexDBlack

This comment has been minimized.

Copy link
Contributor

@AlexDBlack AlexDBlack commented Oct 28, 2019

It's not possible to backport fixes to a past release (and keep the same version name, anyway).
We expect that there will be a new release soon (next few weeks).

Also new snapshots will be available some time this week, that will include the fix: https://deeplearning4j.org/docs/latest/deeplearning4j-config-snapshots
snapshots are not being built at present but that will be fixed in the next few days
keep an eye on the timestamps here, or ask in gitter if you want an update - https://gitter.im/deeplearning4j/deeplearning4j
https://oss.sonatype.org/content/repositories/snapshots/org/deeplearning4j/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.