# how can i provide one input vector to some neurons in the hidden layer and another input vector to some other neurons of the same hidden layer in matlab

조회 수: 3 (최근 30일)
Preeti Prajapati 2014년 5월 25일
답변: Greg Heath 2014년 5월 29일
I want to create a neural network with 2 input vectors.I am using 2 layer neural network with 10 neurons in the hidden layer. But the problem is i have to provide 1st input vector to 1st 5 neurons of the hidden layer and 2nd input vector to next 5 neurons of the same hidden layer. I searched all the properties of the neural network but none solved my problem. Please help me out with this.

댓글을 달려면 로그인하십시오.

### 채택된 답변

Greg Heath 2014년 5월 29일
WHOOPS!. At one time when weights were initialized at EXACTLY zero, they would not be updated. Now I don't recall if was MATLAB's code that was changed or it was one of my personal codes.
Regardless, it doesn't work here and I apologize for the bum steer.
What you have to do is to eliminate the connections entirely instead of setting the initial weights to zero. That is explained in the documentation under the name "Custom Networks".

댓글을 달려면 로그인하십시오.

### 추가 답변 (1개)

Greg Heath 2014년 5월 26일
After creating a 10-input net, set the appropriate weights of net.IW to zero; You will have to work out the details but the general idea is
net.IW{1:h1 , i1+1:end} = 0;
net.IW{h1+1:end , 1:i1 } = 0;
Hope this helps.
Thank you for formally accepting my answer
Greg
##### 댓글 수: 1이전 댓글 -1개 표시이전 댓글 -1개 숨기기
Preeti Prajapati 2014년 5월 29일
Thank you for this answer. Sir,I am unable to understand the command: net.IW{1:h1 , i1+1:end} = 0. I tried to assign weights to 0 by using the following code: a=[0.2; 0.3; 0.4; 0.1; 0.2; 0; 0; 0; 0; 0]; b=[0; 0; 0; 0; 0; 0.1; 0.1; 0.3; 0.2; 0.2]; IW = [a b]; net.IW{1,1} =IW; But Sir, this doesn't solve my problem as the weights I set 0 are altered when I train the network. I want to connect 1 input to some neurons of the hidden layer and another input to some other neurons of the same layer.

댓글을 달려면 로그인하십시오.

### 카테고리

Help CenterFile Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by