0
votes

I am struggling to create a customized neural network in MatLab. I've made a sketch of my intended neural network.

To explain better how the network should work:

  • Two input parameters (features) connected to the first hidden layer with two neurons (exactly equal to the number of input parameters)
  • Each input parameter is connected to one neuron only.
  • No bias in the first hidden layer.
  • All the neurons in the first hidden layer are connected to the neurons in the second layer. There is a bias term in the second layer.
  • The neurons from the second hidden layer is connected to one output.
  • For simplicity, I did not show the projection functions in the plots. Could somebody help me with creating this (probably) simple customized network?

I appreciate your help.

1
Hi, mind sharing some code with us?hakamairi
Sure, this is what I tried: net = network; net.numInputs = 2; net.inputs{1}.size = 1; net.inputs{2}.size = 1; net.numLayers = 2; net.layers{1}.size = 1; net.layers{2}.size = 3; net.inputConnect(1) = 1; net.inputConnect(3) = 1; net.layerConnect(2) = 1; net.outputConnect(2) = 1; view(net) The problem is that my output layer size is 3 and I doubt if I am doing it right.Pejman sho
@Pejmansho, what does that extra layer actually accomplish, given that in a normal network the inputs are going to have a weight applied to them before being fed to the neuron? In other words, what does input*weight_1*transfer_function*weight_2 give you that you can't achieve with input*weight?beaker
@beaker My main idea is to quantify the weighted inputs contribution to the network prediction. If I use a standard feedforward, all the inputs are connected to all the weights and it will be more difficult to decompose the contributions.Pejman sho

1 Answers

0
votes

You want a feedforwardnet, in your example you have one layer of 3 neurons and an output layer but no bias on the neurons. For this you'll need to set up your network and change the net.biasConnect element

net = feedforwardnet(3);
net.biasConnect(1) = false;
view(net)

Once you train the network the rest will come into place.