Note that there are some explanatory texts on larger screens.

plurals
  1. POMultiplying weight matrix of a trained neural network with a test vector
    primarykey
    data
    text
    <p>I trained the perceptron neural network and obtained the weight matrix using matlab.</p> <p>The dimension of the obtained weight matrix is &lt;50x1 double></p> <p>Now while giving the test input, I have a &lt;1x1 double> value, that need's to be tested.</p> <p>If I multiply the weight matrix with the value, I get &lt;50x1 double>. How can I set threshold for &lt;50x1 double> value.</p> <p>Is there any way to get around this problem ?</p> <p>This is the code</p> <pre><code>tic clc; clear all; close all; %function [ w1, bias ] = percep1( x ) zzz = xlsread('D:\matlab\NN_FILES\train_mean.xlsx') s = zzz; learning_rate = 0.1; % go with the loop mohan theta = 10000; w1=0; for j = 1:50 x=s(:,j);t=1; bias=0; stopp=1; count=0; while stopp yin = bias + (w1*x); % activation function if yin &gt; theta y = 1; elseif yin &lt; -theta y = -1; else y = 0; end if (t ~= y) % for i = 1 : 7 %if ( x(i) ~= 0 ) w1 = w1 + ( learning_rate * t * x); %end % end bias = bias + ( learning_rate * t); end count = count + 1; if t==y stopp = 0; count; end end w(j,:) = w1; b1(j) = bias; e1(j) = count; end new_weights_2 = w(50,:) yyy= xlsread('D:\matlab\NN_FILES\test_mean.xlsx'); st=yyy; theta2 = 1.0e+04 * 1.2 ; for j=1:20 x=st(:,j); yin=(new_weights_2(1))*(x) output(j) = yin; if yin &gt; theta2 y = 1; elseif yin &lt; -theta2 y = -1; else y = 0; end y1(j)=y; end toc </code></pre> <p>Now I have used only the first value of the weight matrix inorder to satisfy the multiplication rule. Is there any way to multiply the weight matrix with the test input ?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload