/Computational-Intelligence-Tutorials

This is the repository of codes written in class.

Primary LanguageJupyter NotebookApache License 2.0Apache-2.0

Computational Intelligence Tutorial

In this repository, we will cover the material of the Computational Intelligence course which originated in University of Guilan. This repo will demonstrate how you could implement Metaheuristic Algorithms in Python. Therefore, if you are interested in learning the implementation of Metaheuristic Algorithms and understanding them with cool visualization techniques, this is the right place for you. (The goal of making this content was enabling others to learn Metaheuristic Algorithms on their own; therefore, if you can't be present in the class, you can learn all of the material using this repository.)

Prerequisites

Before you start this tutorial, you should know:

  • Python - If you don't know python, but you know how to program, you can learn it in first week of this class.
  • Numpy Library - If you don't know Numpy, you can learn it in first week of this class.
  • Algorithms & Datastructures - If you don't know Algorithms & Datastructures, you can learn it here.

Weekly Content

First Week

  • Python
    • Basic Data Types
    • Containers
    • Functions
    • Classes
  • Numpy
    • Creating Arrays
    • Array Data
    • Reshaping an Array
    • Arithmetic Operations on Arrays
    • Conditional Operators
    • Mathematical and Statistical Functions
    • Array Indexing
    • Iterating
    • Saving and loading

Second Week

First three steps of Implementing Genetic Algorithms :

  • Population Initialization
  • Fitness Calculation
  • Selection Operators
  • Introduction to Knapsack problem
  • How you can create a fake data for Knapsack problem

Third Week

  • Last two steps of implementing the Genetic Algorithms :
    • Crossover
    • Mutation
  • Solving Knapsack problem with Brute Force Algorithm
  • Solving Knapsack problem with Genetic Algorithm
  • Visualization of Genetic Algorithm output

Fourth Week

  • How to find the minimum point of various functions
  • How to represent a floating-point chromosome as a binary chromosome
  • Uniform Mutation (Floating-point representation)
  • Linear Recombination Crossover
  • Genetic Algorithm (Floating-point Representation)
  • 3-D Visualization of every function & its fitness

Fifth Week

  • Full ACO algorithm to find sub-optimal solutions for Travelling Sales Man (TSP) Problem
  • Implementing Three strategies for ACO algorithm including Ant-cycle AS, Ant-density AS, and Ant-quantity AS
  • Designing the visualization of the final route which ACO discovered

Sixth Week

  • Full PSO algorithm to find the minimum point of Rastrigin Function
  • 3-D Visualization of sequential progress of PSO algorithm
  • 2-D Visualization of sequential progress of PSO algorithm

Seventh Week

  • A detailed description of Binary Logistic Regression
  • Full clean implementation of Logistic Regression to discriminate Iris-setosa flower from other types of flowers
  • Visualization of flowers features and the discriminatory line between the features