I need a Neural Network determining service availabilites through host availabilities using and emitting binary data (only 0 or 1)

1 view (last 30 days)
hi,
I am currently working on a problem and I want to use Neural Networks. I want to determine the n service availabilities through m host availabilities (0: av., 1: not av.) and m > n. I have tried solving the problem using the nn fitting tool. With the default values the training worked fine but since the transfer function is 'purelin', linear by default, I don't get binary output data.
To get binary outputs I have set the transfer function to 'hardlim'. But when doing so the training doesn't happen and I get the message 'minimum gradient is reached'. Even after setting min_grad to a lower value (10^-30 or even 0) the problem is not solved. I get the same message.
Is there a way to solve this issue? Or am I on the wrong track by using the nn fitting tool? Is the pattern recognition tool better suited for this kind of problem? If yes, how is the best way to configure the network?
Best Regards Roia
  1 Comment
kamogelo
kamogelo on 1 Mar 2024
hello
i am working on a problem and i am using matlab to find hardlim but it keeps on telling me hardlim requires Deep learning toolbox so how can i solve this

Sign in to comment.

Accepted Answer

Greg Heath
Greg Heath on 8 Mar 2014
The pattern fitting tool is the one to use.
However, if you train with purelin or, better yet, logsig , you can always
replace with hardlim in the operational mode or, just use round on the output.
Hope this helps.
Thank you for formally accepting my answer
Greg
  2 Comments
Roia
Roia on 11 Mar 2014
Hi,
I tried the patternnet to implement the network and it worked fine. Using the logsig transfer function I get an output between 0 and 1 which I can later set to a binary value. What I don't get is the classification. When looking at the confusion plot, I get a 13x13 matrix (since it has 13 outputs), each column standing for the target class, so there are 13 classes. I realized the network outputs are divided into classes, depending where the first '1' appears. Meaning:
[1;x;...x] -> class one
[0;1;x;...;x] -> class two
[0;0;1;x....;x] -> class three
as each row of the vectors above represent one service and their value determines whether it is available or not, a right classification can lead to the wrong prediction in my case.
for example: if network output is [0;0;1;0;1] and target output is [0;0;1;0;0] both will be classified as three, so I get a correct classification, but a wrong network output (output 5 should be 0 instead of 1).
The only solution I can think of is creating a seperate network for each output. Is there another way to solve this problem?
Greg Heath
Greg Heath on 12 Mar 2014
I deleted my previous comment re functions ind2vec, softmax and vec2ind because I thought that your classes were mutually exclusive.
I think your problem is that the confusion matrix also assumes that classes are mutually exclusive
In which case you probably have to check each output component to see if it equals or exceeds a specified classification threshold.
If all thresholds are 0.5, the function round will do the trick.
You also have to modify the confusion matrix logic to accommodate non-exclusive classes.
Hope this helps.
Greg

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!