Neural network construction where different outputs have different dependencies on the inputs
1 次查看(过去 30 天)
显示 更早的评论
I want to construct a neural network for a system which is described by the image below. The arrows in the images shows the dependencies of the variables in the system (e.g., is dependent on ). I have two inputs and and outputs and , ,..., , . Three intermediate variables , and connect the inputs and outputs together, while the outputs , ,..., , have dependencies sequentially and is dependent on all the . How can I construct a neural network where the inputs are and and the outputs are and , ,..., , ?
1 个评论
Ben
2024-4-9
The diagram suggests depends on and depend on (via ). Could you clarify how the simultaneous dependency should be handled?
One way might be a recurrent style network - all the variables are actually time series, and depends on , while depend on . You would hook up a neural network with the and as outputs and write code to feed the back into the network at the next time step.
回答(1 个)
Jayanti
2024-10-3
Hi Xuming,
You can start by defining all the layer component with appropriate size. Let’s assume you have input layer of size 10 (you can choose according to your requirement).
x_A = featureInputLayer(10, 'Name', 'x_a');
Similarly, you can create another input layer .
Now you can create intermediate layer of (suppose) size=20.
I_1 = fullyConnectedLayer(20, 'Name', 'I_1');
Similarly create other two layers and .
For explanation, I am assuming n=3 that is we have three layers which is referred as , and . You can extend this to any value of n. Below code will create layer with size=10.
y_B1 = fullyConnectedLayer(10, 'Name', 'y_b1');
Similarly define for other layers like and , .
Now you need to connect all the layers according to your need. I am attaching the code for your reference.
layers = connectLayers(layers, 'x_a', 'I_1');
layers = connectLayers(layers, 'I_1', 'I_2');
layers = connectLayers(layers, 'I_2', 'I_3');
layers = connectLayers(layers, 'x_b', 'y_b1');
layers = connectLayers(layers, 'x_b', 'y_b2');
layers = connectLayers(layers, 'x_b', 'y_b3');
layers = connectLayers(layers, 'I_3', 'y_b1');
layers = connectLayers(layers, 'y_b1', 'y_a/in1');
layers = connectLayers(layers, 'y_b2', 'y_a/in2');
layers = connectLayers(layers, 'y_b3', 'y_a/in3');
layers = connectLayers(layers, 'y_a', 'I_3');
Also I am attaching the documentation link for various layers for your reference:
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!