3
$\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 Martin 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 Alsmick'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$
  • 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 Apr 10 '18 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$ – Craig Carter Apr 10 '18 at 15:45
6
$\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$
  • $\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$ – Craig Carter Apr 10 '18 at 15:40
  • 1
    $\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$ – Markus van Almsick Apr 11 '18 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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