Self-Organizing Learning Array for Classification SOLAR_C

46
Self-Organizing Learning Array for Classification SOLAR_C Basic Organization and Software Janusz Starzyk Ohio University

description

Self-Organizing Learning Array for Classification SOLAR_C. Basic Organization and Software Janusz Starzyk Ohio University. SOLAR Basics. The training data is presented to the network in form of feature vectors . Each feature vector contains one coordinate of each data point . - PowerPoint PPT Presentation

Transcript of Self-Organizing Learning Array for Classification SOLAR_C

Page 1: Self-Organizing Learning Array for Classification SOLAR_C

Self-Organizing Learning Array for Classification SOLAR_C

Basic Organization and Software

Janusz StarzykOhio University

Page 2: Self-Organizing Learning Array for Classification SOLAR_C

SOLAR Basics• The training data is presented to the network in form of

feature vectors. • Each feature vector contains one coordinate of each

data point.• M input data points used for training are described by N-

dimensional vectors. • So the NN have N inputs and reads the information in

parallel from M feature vectors.• The NN is a feed forward structure that can decide

about its own interconnections and neuron operations. • It has a prewired organization that contains a number of

neurons, which are pseudorandomly connected to the input nodes and other neurons

• An entropy based evaluator (EBE) is used to select a proper operation and inputs for each neuron.

Page 3: Self-Organizing Learning Array for Classification SOLAR_C

Organization of SOLAR structure

MbyNMUX

+/-

EBE EBE EBE

ThresholdValue

MbyNMUX

+/-

EBE EBE EBE

ThresholdValue

MbyNMUX

+/-

EBE EBE EBE

ThresholdValue

MbyNMUX

+/-

EBE EBE EBE

ThresholdValue

MbyNMUX

+/-

EBE EBE EBE

ThresholdValue

MbyNMUX

+/-

EBE EBE EBE

ThresholdValue

MbyNMUX

+/-

EBE EBE EBE

ThresholdValue

MbyNMUX

+/-

EBE EBE EBE

ThresholdValue

EBE

ThresholdValue

Page 4: Self-Organizing Learning Array for Classification SOLAR_C

• In the FF organization, as new neurons are added, their outputs can be used as inputs in subsequently generated new neurons.

• In this organization neurons generated later in the process cannot feed neurons generated earlier.

• A FF organization is always stable.

Feed-forward (FF) structure

Page 5: Self-Organizing Learning Array for Classification SOLAR_C

• In the FB organization all neurons are generated concurrently.

• Inputs of each neuron can be connected to outputs of any neuron (including itself).

• An FB arithmetic organization may become unstable in case a positive feedback causes the increase in the input signal values.

• We must guarantee that the transformation obtained is contractive, which means that the norm of the output of a neuron must be less or equal to the average norm of all the inputs.

Feed-back (FB) structure

Page 6: Self-Organizing Learning Array for Classification SOLAR_C

Signal processing in SOLAR

• We know that the best linear transformations may be evolved by iteratively applying Haar wavelet.

• Since Haar wavelet requires averaging and difference of the two inputs we can evolve the learning hardware by using an adder-subtractor with the right shift.

• The reduced-instruction set processor (RISP) is programmed to either perform addition or subtraction and the right shift of the result

• The same RISPs can be used in FF and FB structures.

• RISP can also perform selected nonlinear or logic operations on its inputs

Page 7: Self-Organizing Learning Array for Classification SOLAR_C

Initial neurons’ wiring in FF structure

• A fixed number of neurons is added per each layer

• Connections to closest neighbors are generated with higher probability

• Neurons can be identified by their position (row,col) on the grid

• Manhatan distance between two neurons

abs(row1-row2)+abs(col1-col2)

Page 8: Self-Organizing Learning Array for Classification SOLAR_C

Generating random connections

• To obtain a random variable y with a specific pdf(y) function from the uniform distribution pdf(x) first calculate the CDF function

• and then using the uniform random variable x find the value of the resulting samples y with desired pdf function pdf(y) from

• If no analytical function for CDF inverse can be found use the point-by point mapping

y x 1( )

1

0

)()( dyypdfyx

Page 9: Self-Organizing Learning Array for Classification SOLAR_C

Example • Suppose that we want to generate random numbers with

pdf(x)=sin(x*pi)). • The following Matlab code was used for demonstration  

Generating random connections

y=(1:100)/100;pdfy=sin(pi.*y).*pi./2;x=(1-cos(pi.*y))./2;t=acos(2.*x-1)/pi;plot(t)x=rand(1000,100);t=acos(2.*x-1)/pi;hist(t,50)

Page 10: Self-Organizing Learning Array for Classification SOLAR_C

• histogram of 100 experiments each with 1000 data points generated.

Generating random connections

Page 11: Self-Organizing Learning Array for Classification SOLAR_C

Neuron’s Inputs/Outputs

Inputs from other neurons

System logic output

Output to other neurons

Control outputsCO, COT, COTI

NeuronId #

(I, F, Th)

Control input CI

Page 12: Self-Organizing Learning Array for Classification SOLAR_C

Control input • Each neuron is clock controlled. • At each clock cycle it is assumed that a different data

point is transmitted through the network.• Control input (CI) is used to activate the neuron

operation. • Control input is obtained from the control outputs (CO)

of the feeding neuron. 1. CO = CI of this neuron 2. COT = CI AND neuron’s threshold output – 3. COTI= CI AND the inverted neuron’s threshold output

• Neuron’s threshold output T is defined together with operation of a neuron.

Page 13: Self-Organizing Learning Array for Classification SOLAR_C

Neuron’s signal inputs•              Each neuron has several signal inputs and

two control inputs Each CI input uses CO, COT, or COTI of the

control feeding neuron (CFN) and reads its output information deficiency

Neuron selects two (or one) of its inputs to perform a selected arithmetic or logic

operation on them producing outputs distributed to other neurons.

Neuron first selects one of its threshold-controlled inputs and reads the output information deficiency of the CFN

Page 14: Self-Organizing Learning Array for Classification SOLAR_C

Neuron’s arithmetic operations

• L(a) returns the location (starting from 0) of the most significant bit position of a,

• E(a) forces 1 on a-th bit position  

• We have L(E(a))=E(L(a))=a

a 0 1 2 4 8 16 32 64 128

L(a) 0 1 2 3 4 5 6 7 8

a 0 1 2 3 4 5 6 7 8

E(a) 0 1 2 4 8 16 32 64 128

Page 15: Self-Organizing Learning Array for Classification SOLAR_C

Refined arithmetic operations

 A refined logarithm function Lm(a) related to L(a) as follows: 

 

L=Lm(a)=Li(a)+farc(a/2^Li(a))=Li(a)+ frac(shr(a,Li(a))) Where shr(a,b) represents shift a right by b bits and frac(a) is the fraction part of a

E=Em(a)= (1+fract(a))*2floor(a)=shl((1+fract(a)),floor(a))

a 0 1 2 4 8 16 32 64 128

Li(a) 0 0 1 2 3 4 5 6 7

Page 16: Self-Organizing Learning Array for Classification SOLAR_C

Neuron’s arithmetic operations Assume that we use B bits fixed precision arithmetic

• Add(a,b)=(a+b)/2 addition•  • subtraction  

• Mult(a,b)=E(Sub(L(a)+L(b),B)) multiplication•  • Divd(a,b)=E(Sub(L(a),L(b))) division•  • Root(a)=E(L(a)/2+B/2) square root 

baif

baifbabaSub

0),(

Page 17: Self-Organizing Learning Array for Classification SOLAR_C

Neuron’s arithmetic operations • Invr(a)=E(Sub(B,L(a))) inverse

• Sqre(a)=E(Sub(2L(a),B))) square•  • Qdrt(a)=E(L(a)/4+3B/4)) quadruple root•  • Qdre(a)=E(Sub(4L(a),3B))) power 4•  • Log2(a)= E(L(L(a))+B-L(B)) logarithm • (for B=8 Log2(a)=L(a)*16 )•  • Exp2(a)= E(Sub((L(a),B-L(B)))) exponent• (for B=8 Exp2(a)=E(a/16) )  

Page 18: Self-Organizing Learning Array for Classification SOLAR_C

Neuron’s arithmetic operations a=(1:256);b=(1:256);la=log2(a);lb=log2(b);lla=log2(la(2:256));plot(2.^(la+lb-8),':') %plot multiply functionhold onplot(a,'--') %plot input functionplot(2.^(la/2+4),':') %plot squre root functionplot(2.^(8-la),'-') %plot inverse functionplot(2.^(lla+5),'-.') %plot logarithm functionplot(2.^(a/32),'-') %plot exponent functionlegend('square','input','square

root','inverse','logarithm','exponent')title('Selected functions of the positive integer input from 0 to

255');plot(4.^(la+lb-12),':') %plot power 4 functionplot(2.^(la/4+6),':') %plot quadruple root function

 

Page 19: Self-Organizing Learning Array for Classification SOLAR_C

Neuron’s arithmetic operations

 

0 50 100 150 200 250 3000

50

100

150

200

250

300S elec ted func tions of the pos it ive integer input from 0 to 255

s quare

input

s quare root

invers e

logarithm

exponent

Page 20: Self-Organizing Learning Array for Classification SOLAR_C

Neuron’s arithmetic operations

 a=(1:255);b=(1:255)/32;la=dec2bin(a);for i=1:size(a,2) Li(i)=8-min(find(la(i,:)=='1'));end;Lm=32*((a./(2.^(Li))-1)+Li);plot(Lm,':')hold onplot(32*log2(a))title('The logarithm and its approximation')figure(2)Em=2.^floor(b).*(1+(b-floor(b)));plot(Em,':')hold on plot(2.^b)title('The exponent and its approximation')

Page 21: Self-Organizing Learning Array for Classification SOLAR_C

Neuron’s arithmetic operations

 

Page 22: Self-Organizing Learning Array for Classification SOLAR_C

Neuron’s arithmetic operations

 

Page 23: Self-Organizing Learning Array for Classification SOLAR_C

Neuron’s arithmetic operations

 

Example Consider a binary representation of a=237d= 11101101b and calculate

the logarithm of a using Lm(a)=Li(a)+frac(shr(a,Li(a))) Define first the position of the most significant bit. In this case Li(a)=7 (as the 8th bit was the most significant). In the binary notation 7 d =111 b so we append 111 with the fraction

obtained by the remaining bits of a to obtain Lm(a)=111.1101101 b =

7.8516. The exact value of log2(a)=7.8887

 Similarly calculate 23.425= 10.7406 using Em(a)=shl((1+fract(a)),floor(a))Since a=3.425=11.011011 b, we have the floor(a)=3. So we obtain the

exponent by shifting 1+fract(3.425)=1.011011 b to the left by 3 bits,

therefore Em(a)= 1011.011 b =11.375.

Page 24: Self-Organizing Learning Array for Classification SOLAR_C

Simplified sigmoidal functions

Typical sigmoidal functions used in backpropagation learning include hyperbolic tangent and inverse tangent functions.

Using the approximate of the exponent operation, we can implement simpler sigmoidal function for NN training

x

x

e

exxf

1

1

2tanh)(1

2tan

2)( 1

2

xxf

xexsignxf 1)()( Matlab code:f(x)=2.^(-floor(a)-1).*(2-(a-floor(a)));

Page 25: Self-Organizing Learning Array for Classification SOLAR_C

                   These sigmoidal functions can be compared as follows

Simplified sigmoidal function

 

Has xexsignxf 1)()(

Function

Has simple derivative easily related to its value

02)(1

0)(1)(*)(1)('

xforexf

xforexfxfxsignxf

x

x

**)(**2 ' Tyxwhereyxfe

such that weights in backpropagation can be easily updated using

and e is an output error

Page 26: Self-Organizing Learning Array for Classification SOLAR_C

Approximation of the exponent function

Page 27: Self-Organizing Learning Array for Classification SOLAR_C

Approximation error

Page 28: Self-Organizing Learning Array for Classification SOLAR_C

Neuron’s self-organizing principles

• Total local sample count: the neuron counts the number of samples transmitted.

• Neuron performs an operation on the selected inputs. CI high, compare against a set threshold value; CI zero, data is not in the selected subspace - no

comparison

• Probabilities of samples from various classes satisfying and not satisfying the threshold value are estimated.

• The threshold partitions the input space of a given neuron into two subspaces.

Page 29: Self-Organizing Learning Array for Classification SOLAR_C

Neuron’s self-organizing principles

• Suppose that the number of points from class c that satisfied the threshold equals to nsc.

• The probability of this class samples satisfying the threshold is

• Subspace probabilities and local class probabilities can be estimated by

t

ss n

np

t

scsc n

np

t

cc n

np and

Page 30: Self-Organizing Learning Array for Classification SOLAR_C

Neuron’s self-organizing principles

• Information index.

where the summation is performed with respect to all classes and two subspaces

• The information index should be maximized to provide an optimum separation of the training data.

• When the information index equals to 1, the classification problem is solved completely.

ccc

sssc

scscs

pp

pppp

E

EI

)log(

))log()log((11

max

Page 31: Self-Organizing Learning Array for Classification SOLAR_C

0 0.2 0.4 0.6 0.8 1 0

0.02

0.04

0.06

0.08

0.1

0.12

0.14

information

con

ditio

nal p

roba

bilit

y P

12w

Neuron’s self-organizing principles

ccc

sssc

scscs

pp

pppp

E

EI

)log(

))log()log((11

max

Page 32: Self-Organizing Learning Array for Classification SOLAR_C

0

5

10

15 0 .2

.5 .75

1

-15

-10

-5

0

5

average information level

log2 of the number of the MC points

log2

of t

he n

orm

aliz

ed in

form

atio

n er

ror

Normalized standard deviation of the information estimated by MC simulation

Neuron’s self-organizing principles

Page 33: Self-Organizing Learning Array for Classification SOLAR_C

Subspace Learning

• To accumulate learning results from different subspaces we must weight the amount of added learning against increased system complexity and the classification error.

• Subspace information deficiency (normalized relative subspace entropy)

• Information deficiency indicates how much knowledge must be gained to resolve the classification problem in the given subspace.

• Input information deficiency for the first layer of neurons is equal to 1.

ccc

sssc

scscs

s

pp

pppp

E

E

)log(

)log()log(

max

Page 34: Self-Organizing Learning Array for Classification SOLAR_C

Subspace Learning

• The information index and information deficiencies are simply related as

• Each subspace can be separately learned by minimizing its information deficiency.

• In order to select a feature with the largest improvement in overall information maximize the information deficiency reduction

s

sI 1

si

sisss

ss IE

EIsR )1(

max

)max(

Page 35: Self-Organizing Learning Array for Classification SOLAR_C

Subspace Learning

• Output information deficiency is the product of the local subspace information deficiency with the input information deficiency.

• If the CO is the same as the CI for a given neuron, then the output information deficiency is equal to the input information deficiency.

I

LO

O

COCOTCOTI

NeuronId #

(I, F, Th)

CI

Page 36: Self-Organizing Learning Array for Classification SOLAR_C

Subspace Learning

• In subsequent space divisions the information deficiency must be replaced by the accumulated information deficiency expressed as a product of information deficiencies in each subsequent partition.

where the product is taken with respect to all partitions• Pass the value of accumulated information deficiency to

the next neuron as its input information deficiency.

• The information deficiency reduction is calculated as

p

sp

sin IsR

Page 37: Self-Organizing Learning Array for Classification SOLAR_C

Subspace Learning

• The port organization of the RISP entity related to information processing in a given neuron is as shown

Input data

CI and in

Logic (voting) output

Output data

CO, COT, COTI and related out

RISP

Selected RISP operation

Page 38: Self-Organizing Learning Array for Classification SOLAR_C

Subspace Learning

• Neuron’s information index is used to predict reduction of the subspace entropy.

• This reduction will take place only if the subspace is really divided using the selected threshold.

• This is accomplished by selecting the COT or COTI to drive CI of another neuron or the system output.

• If instead, CO is selected as the next neuron CI, then no division takes place and neurons role is only used to better organize the input data.

Page 39: Self-Organizing Learning Array for Classification SOLAR_C

Subspace Learning

• Several neurons may need to act on the input data in a given subspace before the subspace is divided.

• The rate of selection of the CO over selection of COT or COTI is set experimentally.

• It determines a statistical parameter - probability of subspace selection that is the probability of selecting either COT or COTI as the neuron’s CI.

Page 40: Self-Organizing Learning Array for Classification SOLAR_C

Information Error and Final Classification

• The more partitions were done, the smaller the value of the accumulated information deficiency.

• Once this value reaches a specified threshold the learning must stop.

• This threshold depends on the size of the training data and must not be smaller than the information deficiency error that results from the size of the confidence interval.

• Set information deficiency threshold (IDT) and define the neuron outputs COT or COTI to be the self-organizing neural network outputs (SONNO).

Page 41: Self-Organizing Learning Array for Classification SOLAR_C

• During training, establish which class each SONNO is most correlated to and calculate the probability of correct classification for each one.

• estimate the probability of correct classification for each class using:

nc is the times the SONNO went high for each training class, nt: is the total number of times it was high.

t

ccc n

np

Information Error and Final Classification

Page 42: Self-Organizing Learning Array for Classification SOLAR_C

• Note that the SONNO may be quiet for most of the time, so total nt can be small.

• If it is smaller than four or five samples do not use it to

classify since the probability has a large error.

• A fusion function is developed that weights the votes of

each SONNO for each class.

Information Error and Final Classification

ccp

Page 43: Self-Organizing Learning Array for Classification SOLAR_C

• The fusion function provides a score for each target class based upon the training data performance of each SONNO and is computed as:

n

i i

n

ii

c

Pcc

PccPccPcc

W

1

max1

max

1

1

11

1

Where: Pcc max = maximum pcc of all SONNO’s “voting” for

class c Pcci = Pcc of each “vote” for class c n = number of “votes” for class c = small number preventing division by zero.

Information Error and Final Classification

Page 44: Self-Organizing Learning Array for Classification SOLAR_C

• Example:• Suppose that we have 3 classes and 6 SONNO’s and

they have their probabilities Pcc calculated as in the following table

class 1 2 3

SONNO1 0.9 0.1 0.1

SONNO2 0.3 0.6 0.1

SONNO3 0.2 0.2 0.6

SONNO4 0.1 0.2 0.7

SONNO5 0.2 0.7 0.1

SONNO6 0.2 0.1 0.7

Information Error and Final Classification

Page 45: Self-Organizing Learning Array for Classification SOLAR_C

• Suppose that 4 test samples were sent through the system and the following outputs went high (as shown in table).

• The calculated values for each class are as shown in the table.• The winning classes are class # 1, 2, 3, and 3 for these four

samples.

SONNO # and vote Class # and weight Wc

1 2 3 4 5 6 1 2 3

1 0 1 1 0 0 0.9126 0.3908 0.8301

0 1 1 0 0 0 0.4960 0.7120 0.6898

0 1 0 1 0 1 0.4775 0.7038 0.8521

0 0 0 0 1 1 0.4080 0.7615 0.7615

Information Error and Final Classification

Page 46: Self-Organizing Learning Array for Classification SOLAR_C

Neuron’s StructureThe internal block level structure of a neuron

TCO, TCOT, TCOTI and related out

TCI

RISP

Select RISP operation Select threshold

MUX Output data

Select inputs

Comparator

Subspace Counter

Input counter

Entropy based evaluator

in

Voting output

Input data