neural network tutorial 3

Upload: maulik

Post on 06-Jul-2018

234 views

Category:

Documents


1 download

TRANSCRIPT

  • 8/17/2019 neural network tutorial 3

    1/32

    BITS PilaniDubai Campus

    BITS F312 NNFL

  • 8/17/2019 neural network tutorial 3

    2/32

    BITS PilaniDubai Campus

    Dr.V.KALAICHELVI.,ASST.PROF/EEE

  • 8/17/2019 neural network tutorial 3

    3/32

    BITS Pilani, Dubai Campus

    ● S-shaped function

    ●  Z-shaped function

    ●  Triangular Membership Function

    ●  Trapezoidal Membership Function

    ●  Gaussian Distribution Function

    ●  Pi function

    Various Types of Membership Function

    V.Kalaichelvi., Asst.Prof/EEE

  • 8/17/2019 neural network tutorial 3

    4/32

    BITS Pilani, Dubai Campus

    S shaped membership Function

    V.Kalaichelvi., Asst.Prof/EEE

    0 , for x  a

    2[(x-a) / (c-a)]2  , for a  x  b

    S(x, a, b, c) = 1- 2[(x-c) / (c-a)]2 , for b < x  c

    1 , for x  c

    a b c

    Figure S-shaped Membership Function

  • 8/17/2019 neural network tutorial 3

    5/32

    BITS Pilani, Dubai Campus

    Program -S shaped membership Function

    V.Kalaichelvi., Asst.Prof/EEE

    x = 0:0.02:1;

    y = smf(x,[0.2 0.45]);

    plot(x,y)xlabel('smf, P=[0.2 0.45 0.65]')

    ylim([-0.05 1.05])

  • 8/17/2019 neural network tutorial 3

    6/32

    BITS Pilani, Dubai Campus

    S shaped membership Function

    V.Kalaichelvi., Asst.Prof/EEE

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

    0

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1

    smf, P=[0.2 0.45 0.65]

       M  e  m   b  e  r  s   h   i  p   f  u  n  c   t   i  o  n

  • 8/17/2019 neural network tutorial 3

    7/32BITS Pilani, Dubai Campus

    V.Kalaichelvi., Asst.Prof/EEE

    S shaped membership Function

  • 8/17/2019 neural network tutorial 3

    8/32BITS Pilani, Dubai Campus

    V.Kalaichelvi., Asst.Prof/EEE

    Program for S shaped MF

  • 8/17/2019 neural network tutorial 3

    9/32BITS Pilani, Dubai Campus

    V.Kalaichelvi., Asst.Prof/EEE

    Program for S shaped MF

  • 8/17/2019 neural network tutorial 3

    10/32BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

  • 8/17/2019 neural network tutorial 3

    11/32BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

    x = 0:0.02:1;y = zmf(x,[0.25 0.45]);

    plot(x,y)

    xlabel('zmf, P=[3 7]')

    ylim([-0.05 1.05])

    Program

  • 8/17/2019 neural network tutorial 3

    12/32BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

    Graphical Representation

    0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

    0

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1

    X: 0.26

    Y: 0.995

    zmf, P=[3 7]

  • 8/17/2019 neural network tutorial 3

    13/32BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

    x = 0:0.1:10;

    y = zmf(x,[3 7]);

    plot(x,y)xlabel('zmf, P=[3 7]')

    ylim([-0.05 1.05])

    Program –Z Membership Function

  • 8/17/2019 neural network tutorial 3

    14/32BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

    Graphical Representation

  • 8/17/2019 neural network tutorial 3

    15/32BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

  • 8/17/2019 neural network tutorial 3

    16/32BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

    x = 0:10:100;

    y = trimf(x,[10 50 90]);

    plot(x,y)

    xlabel('trimf, P=[10 50 90 ]')ylim([-0.05 1.05])

    Program

  • 8/17/2019 neural network tutorial 3

    17/32BITS Pilani, Dubai Campus

    V.Kalaichelvi., Asst.Prof/EEE

    Graphical Representation

    0 10 20 30 40 50 60 70 80 90 100

    0

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1

    trimf, P=[10 50 90]

       M  e  m   b  e  r  s   h   i  p   F  u  n  c

       t   i  o  n

  • 8/17/2019 neural network tutorial 3

    18/32BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

  • 8/17/2019 neural network tutorial 3

    19/32BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

    Program for Trapezoidal

    x = 0:0.1:10;

    y = trapmf(x,[1 5 7 8]);

    plot(x,y)

    xlabel('trapmf, P=[1 5 7 8]')

    ylabel('Membership Function')

    ylim([-0.05 1.05])

    title('Program for Trapezoidal MF')

    grid0 1 2 3 4 5 6 7 8 9 10

    0

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1

    trapmf, P=[1 5 7 8]

       M  e  m   b  e  r  s

       h   i  p   F  u  n  c  t   i  o  n

    Program for Trapezoidal MF

  • 8/17/2019 neural network tutorial 3

    20/32BITS Pilani, Dubai Campus

    V.Kalaichelvi., Asst.Prof/EEE

  • 8/17/2019 neural network tutorial 3

    21/32BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

    x = 0:0.1:20;

    y = gaussmf(x,[2 5]);

    plot(x,y)

    xlabel('gaussmf, P=[2 5]')

    Program for gaussian

    Membership Function

    0 2 4 6 8 10 12 14 16 18 200

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    1.8

    2

    X: 5

    Y: 1

    gaussmf, P=[25]

  • 8/17/2019 neural network tutorial 3

    22/32BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

  • 8/17/2019 neural network tutorial 3

    23/32

    BITS Pilani, Dubai Campus

    This spline-based curve is so named because of its Πshape.

    The membership function is evaluated at the points

    determined by the vector x.

    The parameters a and d  locate the "feet" of the curve,while b and c  locate its "shoulders.“ 

    The membership function is aproduct smf  and zmf membership functions.

    Pi Function

    V.Kalaichelvi., Asst.Prof/EEE

    http://www.mathworks.com/help/fuzzy/smf.htmlhttp://www.mathworks.com/help/fuzzy/zmf.htmlhttp://www.mathworks.com/help/fuzzy/zmf.htmlhttp://www.mathworks.com/help/fuzzy/smf.html

  • 8/17/2019 neural network tutorial 3

    24/32

    BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

  • 8/17/2019 neural network tutorial 3

    25/32

    BITS Pilani, Dubai Campus

  • 8/17/2019 neural network tutorial 3

    26/32

    BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

  • 8/17/2019 neural network tutorial 3

    27/32

    BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

  • 8/17/2019 neural network tutorial 3

    28/32

    BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

  • 8/17/2019 neural network tutorial 3

    29/32

    BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

    Graphical Representation

  • 8/17/2019 neural network tutorial 3

    30/32

    BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

    x = (0:0.1:10)';

    y1 = trapmf(x, [2 3 7 9]);

    y2 = trapmf(x, [3 4 6 8]);

    plot(x, [y1 y2]);

    ylim([-0.05 1.05])

    grid

    0 2 4 6 8 10

    0

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1

    Two Trapezoidal MF in onefigure window

  • 8/17/2019 neural network tutorial 3

    31/32

    BITS Pilani, Dubai CampusV.Kalaichelvi., Asst.Prof/EEE

    x = (0:0.1:10)';y1 = gaussmf(x, [0.5 5]);

    y2 = gaussmf(x, [1 5]);

    y3 = gaussmf(x, [2 5]);

    y4 = gaussmf(x, [3 5]);

    subplot(211); plot(x, [y1 y2 y3 y4]);

    y1 = gaussmf(x, [1 2]);

    y2 = gaussmf(x, [1 4]);

    y3 = gaussmf(x, [1 6]);

    y4 = gaussmf(x, [1 8]);

    subplot(212); plot(x, [y1 y2 y3 y4]);

    Program with Subplotcommand

    0 2 4 6 8 10

    0

    0.2

    0.4

    0.6

    0.8

    1

    0 2 4 6 8 10

    0

    0.2

    0.4

    0.6

    0.8

    1

  • 8/17/2019 neural network tutorial 3

    32/32

    V Kalaichelvi Asst Prof/EEE

    Use of Subplot

    SUBPLOT Create axes in tiled positions.

    H = SUBPLOT(m,n,p), or SUBPLOT(mnp), breaks the Figure window

    into an m-by-n matrix of small axes, selects the p-th axes for

    the current plot, and returns the axes handle. The axes are

    counted along the top row of the Figure window, then the second

    row, etc. For example,

    SUBPLOT(2,1,1), PLOT(income)

    SUBPLOT(2,1,2), PLOT(outgo)

    plots income on the top half of the window and outgo on thebottom half. If the CurrentAxes is nested in a uipanel the

    panel is used as the parent for the subplot instead of the

    current figure.