Showing posts with label Soft Computing Lab. Show all posts
Showing posts with label Soft Computing Lab. Show all posts

Thursday, 6 February 2025

Soft Computing Laboratory Assignments-I, II, III

Syllabus


An outline of the course is as follows.

Introduction to Soft Computing

  • Concept of computing systems.
  • "Soft" compiting versus "Hard" computing
  • Characteristics of Soft computing
  • Some applications of Soft computing techniques

Fuzzy logic

  • Introduction to Fuzzy logic.
  • Fuzzy sets and membership functions.
  • Operations on Fuzzy sets.
  • Fuzzy relations, rules, propositions, implications and inferences.
  • Defuzzification techniques.
  • Fuzzy logic controller design.
  • Some applications of Fuzzy logic.

Genetic Algorithms

  • Concept of "Genetics" and "Evolution" and its application to proablistic search techniques
  • Basic GA framework and different GA architectures.
  • GA operators: Encoding, Crossover, Selection, Mutation, etc.
  • Solving single-objective optimization problems using GAs.

Multi-objective Optimization Problem Solving

  • Concept of multi-objective optimization problems (MOOPs) and issues of solving them.
  • Multi-Objective Evolutionary Algorithm (MOEA).
  • Non-Pareto approaches to solve MOOPs
  • Pareto-based approaches to solve MOOPs
  • Some applications with MOEAs.

Artificila Neural Networks

  • Biological neurons and its working.
  • Simulation of biolgical neurons to problem soloving.
  • Different ANNs architectures.
  • Trainging techniques for ANNs.
  • Applications of ANNs to solve some real life problems.

end



Soft Computing:- It is a family of techniques with the capacity to solve a class of problems for which other conventional techniques are inadequate to solve.

Example:-    The differentiation of any equation of straight lines in slope-intercept form always yields slope.

y = f(x) = mx + c ;    (dy/dx) =m 

y = f(x) = 2D matrix;   (dy/dx) = can not be solved by any traditional techniques; need a soft computing approach for finding the first-order differentiation.

Components of soft computing:-

1.    Fuzzy Systems

2.    Neural Networks

3.    Evolutionary Search Strategies


Hybrid Components of Soft Computing:-

1.    Evolutionary-Fuzzy Systems

2.    Neuro-Evolutionary Systems

3.    Neuro-Fuzzy Systems

4.    Neuro-Fuzzy-Evolutionary Systems


Soft Computing Laboratory Assignments-I

Crisp Sets and Basic Operations


1.    Write python functions to generate the n-population from a given set.

2.    Write python functions to generate the n-sampling sets, each of size k, from a given set.  

3.    Write python functions to compute the union of two crisp sets.

4.    Write python functions to compute the intersection of two crisp sets.

5.    Write python functions to compute the symmetric difference of two crisp sets.

6.    Write python functions to compute the power set of a crisp set.

7.    Write python functions to check whether a crisp set is a subset of another set.

8.    Write python functions to check whether a crisp set is a superset of another set.

9.    Write python functions to check whether two input crisp sets is disjoint or not.
 
10.    Write python functions to implement the following:
            (a)    Add an element in a given set. 
            (b)    Update the set.
            (c)    Remove an element from the set. 
            (e)    Discard an element from the set. 
            (f)     Pop the element from the set.
            (g)    Clear the set. 
            (h)   Distinguish between remove() and discard() functions in python.

 

Soft Computing Laboratory Assignments-II

Fuzzy Membership Functions and Basic Operations



1.    Write python functions to generate the following parameterized fuzzy membership functions and visualize them for different parameter values:

        (a)    Triangular MF

        (b)    Trapezoidal MF

        (c)    Gaussian MF

        (d)    Generalized Bell MF
         
        (e)    PI-MF 
 
        (f)    Z-MF 
 
        (g)    S-MF
 
        (h)    Sigmoid MF


2.    Write python functions to generate asymmetric MF using sigmoidal MFs by the following methods and visualize them:

        (a)    Absolute difference

        (b)    Product


3.    Write python functions to implement following fuzzy complement operations and visualize them for different parameter values:

        (a)    Classical fuzzy complement

        (b)    Sugeno's fuzzy complement

        (c)    Yager's fuzzy complement


4.    Write python functions to implement following fuzzy intersection operations (T-norms) and visualize them for different parameter values:

        (a)    Minimum

        (b)    Algebraic product

        (c)    Bounded product

        (d)    Drastic product


5.    Write python functions to implement following fuzzy union operations (S-norms) and visualize them for different parameter values:

        (a)    Minimum

        (b)    Algebraic product

        (c)    Bounded product

        (d)    Drastic product




Soft Computing Laboratory Assignments-III


Extension Principle, Fuzzy Relations, Linguistic Variables and Fuzzy Reasoning


1.    Write a python function to compute the image of a fuzzy set  A  using extension principle given a mapping function f(x). Test your program for the following cases:


    (a)    A is Triangular MF in the range [1 to 10] and f(x) = x+ 3x3 .

    (b)    A is Trapezoidal MF in the range [1 to 10] and f(x) = x+ 3x3 .

    (c)    A Gaussian MF in the range [1 to 10] and f(x) = x+ 3x3 .

    (d)    A Generalized Bell MF in the range [1 to 10] and f(x) = x+ 3x3 .

    (e)    A Triangular MF in the range [1 to 5] and f(x) = (x-3)2 + 2 .

    (f)    A Trapezoidal MF in the range [1 to 5] and f(x) = (x-3)+ 2 .

    (g)    A Gaussian MF in the range [1 to 5] and f(x) = (x-3)+ 2 .

    (h)    A Generalized Bell MF in the range [1 to 5] and f(x) = (x-3)+ 2 .

    (i)    A Triangular MF in the range [0 to 8] and f(x) = sin(x)
    
    (j)    A Trapezoidal MF in the range [0 to 8] and f(x) = sin(x)

    (k)    A Gaussian MF in the range [0 to 8] and f(x) = sin(x)

    (l)    A Generalized Bell MF in the range [0 to 8] and f(x) = sin(x)



2.    Write a python function to compute the max-min composition of two fuzzy relations.


3.    Write a python function to compute the max-product composition of two fuzzy relations.

4.    Define two suitable primary linguistic terms (using Gaussian MF or Generalized Bell MF) representing old and young people respectively over the age range [0 to 100]. Now obtain the membership functions for the following non-primary terms:

    (a)    not very young and not very old.

    (b)    very young or very old.

    (c)    young but not very young.

    (d)    extremely young or more or less old.

Plot the membership functions for all the primary and non-primary terms on a single plot with proper legends.


5.    Demonstrate the effect of contrast intensification on a fuzzy membership function.

6.    Write python functions for implementing cylindrical extension of a 1 D membership function and projection of a 2 D membership function. Demonstrate the result visually.

7.    Demonstrate the interpretation of fuzzy implication as coupling and entailment with relevent plots.

8.    Given a fuzzy membership function function mf(X) representing the fact x is A and a fuzzy relation R(X,Y) representing the fuzzy implication if x is A then y is B, find the consequent membership function representing y is B. Implement this for both max-min and max-product compositions and demonstrate the process visually. 


9.    Implement the fuzzy reasoning procedure for the following:

        Premise 1 (fact):    x is A' and y is B'
        
        Premise 2 (rule 1):    if x is A1 and y is B1 then z is C1

        Premise 3 (rule 2):    if x is A2 and y is B2 then z is C2
---------------------------------------------------------------------------------------------

        Consequence (conclusion):  z is C'

The notations have usual meaning. Demonstrate the procedure visually.










Home

Soft Computing Laboratory Assignments-I, II, III (click here) PRINCIPAL COMPONENT ANALYSIS (PCA) (click here) Soft Computing Laboratory Assi...