I have a dataset of 192 binary inputs (0/1) and corresponding outputs. I have compressed the inputs to 24 8-bit integers, so that the entire dataset can fit into RAM which greatly speeds up training of the neural network. Obviously, before a batch is trained the 24 8-bit integers have to be expanded to 192 integers. I managed to figure out how to do this in Tensorflow using the ‘map’ functionality of datasets, and now I want to do the same in Mathematica. I found FunctionLayer, but I am getting the error ‘FunctionLayer::compilerr: Cannot interpret map[#1] & as a network.’ on the following code:
I’m new to Mathematica so I’m a little bit guessing here, but for deep neural networks to work all parts of the network needs to be differentiable. Maybe the functional layer cannot support any code and therefore cannot accept map.
I looks like you don’t have any trainable parameter in you input encoding and that part is at the beginning of the net. You can simply move it in a custom Function encoder.
This is a version doing that (and also showcasing some shortcuts for specifiying layers in a NetChain)
the parameter {192} seems to indicate that the output will be an integer vector of length 192. How do I specify to expect an output integer vector of variable length? I can’t find documentation on this. Thank you, Bill