Hi!
Below is an example of the simplest linear multi-input network in Mathematica 14.1 (in fact it was suggested by Grok 3, xAI chatbot):
Below is an example of the simplest linear multi-input network in Mathematica 14.1 (in fact it was suggested by Grok 3, xAI chatbot):
In[]:=
createNetwork[]:=NetGraph[<|"Input1"->LinearLayer[3],"Input2"->LinearLayer[3],"Input3"->LinearLayer[3],"ThreeToOne"->FunctionLayer[Function[{v1,v2,v3},v1+2v2+3v3],"Input"->{3,3,3},"Output"->LinearLayer[3]]|>,{NetPort["Input"]->"Input1",NetPort["Input"]->"Input2",NetPort["Input"]->"Input3",{"Input1","Input2","Input3"}->"ThreeToOne"->"Output"}];
But something is wrong:
In[]:=
net=createNetwork[];
I have tried many obvious ways to fix the code, but all my efforts have led to nothing. Where is the error and how to fix it? I understand that this training task can be solved more simply (and without using three inputs), but my goal is to understand how NetGraph and FunctuionLayer work, so that later I can build more complex neural networks with more inputs.
Vladimir.
Vladimir.
