1.Trying to add an interpolated function to neural networks.
ifun = Interpolation[Table[{x, Tanh[x]}, {x, -100, 100, 0.2}],
InterpolationOrder -> 1]
Plot[{ifun[x], Tanh[x]}, {x, -4, 4}]
2.We implement the function.
net = NetChain[{30, ElementwiseLayer[ifun], 20,
ElementwiseLayer[ifun], 3, SoftmaxLayer[]}, "Input" -> {2},
"Output" -> NetDecoder[{"Class", {Red, Green, Blue}}]]
3.Error
ElementwiseLayer::invscf: InterpolatingFunction[{{-100.,100.}},... could not be symbolically evaluated as a unary scalar function.
4.Please tell me how to fix it.
$ \ LastInternalFailure for potential information.``Consult Internal` $ LastInternalFailure
InvalidJson Non - JSON value : {{KeyAbsent, $Failed}, {KeyAbsent, $Failed}}.
– Глеб May 15 '20 at 15:02