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

Single input element vertex causes workspace validation to fail #6811

Closed
DrChainsaw opened this issue Dec 6, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@DrChainsaw
Copy link
Contributor

commented Dec 6, 2018

The following testcase throws an exception in beta3:

@Test
public void singleInputElemVertex() {
    final InputType inputType = InputType.convolutional(10, 10, 2);
    final ComputationGraph graph = new ComputationGraph(new NeuralNetConfiguration.Builder()
            .graphBuilder()
            .setInputTypes(inputType)
            .addInputs("input")
            .setOutputs("output")
            .addLayer("0", new ConvolutionLayer.Builder().nOut(5).convolutionMode(ConvolutionMode.Same).build(),"input" )
            .addVertex("dummyAdd", new ElementWiseVertex(ElementWiseVertex.Op.Add), "0")
            .addLayer("output", new CnnLossLayer(), "dummyAdd")
            .build());
    graph.init();
    graph.outputSingle(Nd4j.randn(new long[] {1, 2, 10, 10}));
}

Looking at the code of ...impl.ElementWiseVertex, it appears as if the intention is that this shall be a no-op, but the output is not leveraged to the ACTIVATIONS workspace:

    if (inputs.length == 1)
        return inputs[0];

I guess another possibilty is to treat this as an error case in model validation. Given that this was discovered through evolutionary NAS it might be a good idea to make such validation configurable if opted for.

AlexDBlack added a commit that referenced this issue Dec 22, 2018

[WIP] Misc fixes (#6858)
* Javadoc fixes and small cleanup

* More minor fixes

* #6790 Nd4j.arange javadoc

* Clean up + MLN javadoc pass

* #6890 Nd4j.writeAsNumpy javadoc

* #6859 Fix UIServer.detach

* #6811 ElementWiseVertex single input fix

* #6804 Transforms.dot, Transforms.cross

* #6852 Throw original exception on I18N loading errors

* #6841 Fix dropout instances not being cloned when config is cloned

* #6475 INDArray.isInfinite, INDArray.isNaN

* #6856 Allow scoped out in feedForwardToActivationDetached

* Minor test fixes

printomi added a commit to printomi/deeplearning4j that referenced this issue Jan 7, 2019

[WIP] Misc fixes (deeplearning4j#6858)
* Javadoc fixes and small cleanup

* More minor fixes

* deeplearning4j#6790 Nd4j.arange javadoc

* Clean up + MLN javadoc pass

* deeplearning4j#6890 Nd4j.writeAsNumpy javadoc

* deeplearning4j#6859 Fix UIServer.detach

* deeplearning4j#6811 ElementWiseVertex single input fix

* deeplearning4j#6804 Transforms.dot, Transforms.cross

* deeplearning4j#6852 Throw original exception on I18N loading errors

* deeplearning4j#6841 Fix dropout instances not being cloned when config is cloned

* deeplearning4j#6475 INDArray.isInfinite, INDArray.isNaN

* deeplearning4j#6856 Allow scoped out in feedForwardToActivationDetached

* Minor test fixes
@lock

This comment has been minimized.

Copy link

commented Jan 21, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Jan 21, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.