5
$\begingroup$

I'm teaching myself about Mathematica 11.3 Neural Net capabilities, and I can't get a demonstrably previously working example to work. I've been trying for quite a while without success.

In Markus van Almsick's talk at WTC 2017, he gave an example of using a single neuron network and one trained on only one input, extracting an image layer, and then asking the trained net to classify that image layer. The idea instructive, but not necessarily useful. Link to Page with Almsick's talk and notebook, look on the left column near the bottom, see section of notebook about One Neuron Dream.

I think his example version came from a development version of 11.3, I can't get it to work. I'd be very grateful if someone out there could get this example to work in 11.3.

$\endgroup$
2
  • 1
    $\begingroup$ Why don't you share what you have done so far? Try to simplify the problem and give a minimal example what is not working. $\endgroup$
    – user21
    Commented Apr 10, 2018 at 12:16
  • $\begingroup$ You're right. I was making simple modifications of the M v A's notebook. Ended up restarting MMA and all was fine. $\endgroup$ Commented Apr 10, 2018 at 15:45

1 Answer 1

7
$\begingroup$

Haven't gone all the way down (only trained for a couple of secs), but seems to work if you change the following two things:

  1. Inside the net under ConstantArrayLayer, change Table[0.,imageDims] to ConstantArray[0., imageDims]

  2. Inside the NetTrain, add the option LossFunction-> before the list with the loss functions (i.e. LossFunction->{"featureLoss" -> Scaled[1], "imageLoss" -> Scaled[1]})

$\endgroup$
2
  • $\begingroup$ Thanks George and Szabolcs, That fixed it. I had to restart the front end to get this to work, quitting the Kernel wasn't enough. So, hard to learn when that is the solution. $\endgroup$ Commented Apr 10, 2018 at 15:40
  • 2
    $\begingroup$ I can only confirm the answer by Szabolcs and Varnavides. The necessary changes are due to design changes from 11.2 to 11.3. Thanks! $\endgroup$ Commented Apr 11, 2018 at 13:25

Your Answer

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

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