Code covered by the BSD License  

Highlights from
Cluster Reinforcement (CR) phase

image thumbnail
from Cluster Reinforcement (CR) phase by Narine Manukyan
The Cluster Reinforcement (CR) phase advances cluster separation in Self Organizing Maps(SOM).

B_GUI(B, C, A, N1, N2, tor, ci, threshold, lineScale, labels)
function B_GUI(B, C, A, N1, N2, tor, ci, threshold, lineScale, labels)
% B_GUI: handy user-interface for interactively tweaking parameters for DrawBLines.m function
% B_GUI(B, C, A, ci, threshold, lineScale, labels)
%
% PLEASE REFERENCE THE FOLLOWING IF YOU USE THIS CODE:
% N. Manukyan, M.J. Eppstein, D.M. Rizzo,"Data-driven cluster reinforcement 
% and visualization in sparsely-matched self-organizing maps,"
% Neural Networks and learning Systems, IEEE Transactions on, vol23, no 5, pp 846-852,may 2012.      
%
%
% INPUTS:
%         B:         2*N1 x 2*N2 B-matrix (Manukyan et al, 2012), where N1 is
%                    the first dimension of the rectangular SOM map (along Y-axis)
%                    and N2 is the second dimension (along X-axis)
%         C:         N x M matrix of N SOM-trained neurons, each with M features
%                    (i.e., linear form of trained SOM with M component planes)
%         A:         N1 x N2 matrix of input indices stored in the best matching 
%                    neurons locations on the map 
%         N1:        scalar representing the first dimension of the rectangular SOM map
%         N2:        scalar representing the second dimension of the rectangular SOM map
%         tor:       binary flag indicating whather the map is toroidal
%         ci:        scalar that indicates which component plane to be
%                    visualized overlain with the B-matrix.
%         threshold: scalar that serves as threshold for the B-values to be
%                    plotted. 
%        
%         lineScale: scalar multiplier that indicates how line thicknesses scale with B-values. Increase this
%                    value to visually highlight the differences in B-values 
%                    through thicker lines
%         labels:    1 x M char array that contains the labels of input
%                    vectors
% OUTPUT:            Interactive User Interface
%         
%
%
% Authors and Contact information:
% Narine Manukyan
% University e-mail: Narine.Manukyan@uvm.edu
% Lifetime email: narulka22000@gmail.com
%
% Margaret J. Eppstein
% e-mail: Maggie.Eppstein@uvm.edu
%
% Department of Computer Science
% University of Vermont
% Burlington Vermont, 05401
%
% Code posted to Matlab File Exchange: 15-March-2012
    global thresholdSlider;
    global ciSlider;
    global lineScaleSlider;
    thresholdSlider = threshold;
    ciSlider = ci;
    lineScaleSlider = lineScale;
    
    % USE GUI TO SET THRESHOLD, COMPONENT PLANE AND SCALAR MULTIPLIER FOR
    % LINE THICKNESSES
    K = figure;
    set(K,'Position',[450 60 552 620]);
    
    D = DrawBLines(B, C, A, N1, N2, tor, ci, threshold, lineScale, labels);
    
    set(gca,'FontSize',15, 'FontWeight','bold');
    title({['Threshold:   ' num2str(threshold) ];['Component plane:   ' num2str(ci)];['Line Thickness:   ' num2str(lineScale)]});  maxB=max(B(:));
    
    hSlider = uicontrol('style','slider','Min',0,'Max', maxB,'Position',[115 65 352 20], 'SliderStep',[1/(10*maxB) .2],'callback',{@BmatrixCbFcn,B, C, A, N1, N2, tor, labels,1});
    uicontrol('style','slider','Min',1,'Max',size(C,2),'Value',1,'Position',[115 37 352 20], 'SliderStep',[1/size(C,2) 1],'callback',{@BmatrixCbFcn,B, C, A, N1, N2, tor, labels,2});
    uicontrol('style','slider','Min',1,'Max',15/max(B(:)),'Value',1,'Position',[115 10 352 20], 'SliderStep',[1/max(B(:)) 1],'callback',{@BmatrixCbFcn,B, C, A, N1, N2, tor, labels,3});

    parentColor = get(get(hSlider, 'parent'), 'color');
    uicontrol('Style','text','BackgroundColor',parentColor,'FontWeight','bold',...
        'Position',[45 65 65 20],...%[45 40 150 50]
        'String','Threshold');
    uicontrol('Style','text','BackgroundColor',parentColor,'FontWeight','bold',...
        'Position',[45 30 65 30],...%[45 16 150 50]
        'String','Component Plane');
    uicontrol('Style','text','BackgroundColor',parentColor,'FontWeight','bold',...
        'Position',[45 6 65 20],...%[45 -12 150 50]
        'String','Linewidth');
end

Contact us