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: Duplicate name validation #7705

AlexDBlack opened this issue May 10, 2019 · 3 comments


Copy link

commented May 10, 2019

This should throw an exception. I thought we already had validation for this, but apparently not.

SameDiff sd = SameDiff.create();
SDVariable x1 = sd.placeHolder("input", DataType.FLOAT, 5, 3);
SDVariable x2 = sd.placeHolder("input", DataType.FLOAT, 5, 3);

This comment has been minimized.

Copy link

commented May 14, 2019

Hmmm, I write a simple linear regression app using SameDiff,
I use identity activation, but I can't use this code:
val activations = sd.nn().identity(x.mmul(W).add(b0))
There's no identity() method in SDNN class.
I add them into manually:

public SDVariable identity(SDVariable x) {
    return identity(null, x);
public SDVariable identity(String name, SDVariable x) {
    validateFloatingPoint("identity", x);
    SDVariable result = f().identity(x);
    return updateVariableNameAndReference(result, name);

Is it correct?

@AlexDBlack AlexDBlack self-assigned this May 23, 2019

AlexDBlack added a commit that referenced this issue May 25, 2019
SameDiff fixes + improvements; BertWordPieceTokenizer (handle out-of-…
…vocab characters) (#7774)

* Extra overloads for TrainingConfig

* #7678 BERT fixes - control characters etc

* #7678 BERT tokenizer - detect out-of-vocab characters, throw useful exception

* Javadoc/polish

* #7705 SameDiff duplicate name validation

* #7546 SDVariable.getArr scalar issue fix

* SameDiff: add variable renaming

* SameDiff SDVariable renaming javadoc

* Move async iterators to ND4J for use in SameDiff

* Add async iterator support to SameDiff training

* SameDiff listener API

* Base listener, score listener

* Score listener now working

* Fixes and listener polishing

* Small fix

This comment has been minimized.

Copy link
Contributor Author

commented May 25, 2019

Fixed here, and merged to dev branch; will be merged from dev branch to master soon: #7774


This comment has been minimized.

Copy link
Contributor Author

commented Jun 3, 2019

@AlexDBlack AlexDBlack closed this Jun 3, 2019

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