5
$\begingroup$

The documentation states that Subtract is a valid function for use in ThreadingLayer. This produces an internal error however. Try:

net = NetGraph[<|
"Minus" -> ThreadingLayer[Subtract]|>, {{NetPort["in1"], NetPort["in2"]} -> "Minus"}]

and evaluate on some input

net[<|"in1" -> 1, "in2" -> 2|>]

NetGraph::interr: An internal error occurred. Please contact Wolfram Research.

I already reported this to WRI.

$\endgroup$
4
  • $\begingroup$ It might be better if you split off the workaround into an answer instead of putting it in the question. $\endgroup$ Apr 3, 2017 at 8:11
  • $\begingroup$ @J.M. Done that. Thanks $\endgroup$
    – Sascha
    Apr 3, 2017 at 8:30
  • $\begingroup$ @Sascha Do you know how Clip should work in ThreadingLayer? $\endgroup$ Apr 3, 2017 at 16:18
  • $\begingroup$ @AlexeyGolyshev No idea, together with ElementwiseLayer however Clip works like one would expect. $\endgroup$
    – Sascha
    Apr 4, 2017 at 5:31

2 Answers 2

4
$\begingroup$

A workaround is using ThreadingLayer[#1-#2&] instead.

$\endgroup$
4
$\begingroup$

This has been fixed for 11.1.1.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.