Competitive Layer Network (newc) not learning
4 views (last 30 days)
Show older comments
Hello everbody,
i tried to run the expample in the user guide (the one with p = [.1 .8 .1 .9; .2 .9 .1 .8]) and encountered some problems. The weights of the network always stay at .5 .5; .5 .5. Consequently, it cannot divide the inputvectors correctly - they all belong to the same class. Is that a bug or am I doing sth. wrong? Also, the training-function is 'trainru', not 'trainr' as described in the documentatin-but i my opinion, this is correct as there is no target.
Answers (1)
TED MOSBY
on 14 May 2025
Hi Oliver,
This was a known bug in R2010b and R2011a that prevented competlayer / newc networks from updating their weights. The problem was fixed in R2011b and all later versions. Please upgrade to a higher version for the fix.
Additonally you can refer to this MATLAB answer discussion as well: https://www.mathworks.com/matlabcentral/answers/15334-kohonen-example-from-help-does-not-work
Regarding the difference between trainru and trainr :
- trainru: Unsupervised incremental learning, updates weights after each input without targets—Kohonen‑style competitive learning.
- trainr: Supervised incremental learning, updates weights after every input/target pair.
Newc builds an unsupervised competitive network, so its trainFcn is deliberately set to 'trainru'.
Here is the documentation for both the functions:
0 Comments
See Also
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!