Skip to content

This repository contains two subprojects focused on neural networks and a genetic algorithm. The first part involves implementing neural networks using PyTorch, while the second part focuses on developing a genetic algorithm to solve optimization problems.

Notifications You must be signed in to change notification settings

Sabaghip/Neural-network-and-GA-projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Neural Networks and Genetic Algorithm Projects

Overview

This repository contains two subprojects focused on neural networks and a genetic algorithm. The first part involves implementing neural networks using PyTorch, while the second part focuses on developing a genetic algorithm to solve optimization problems.

Table of Contents

  1. Part 1: Implementing Neural Networks with PyTorch
  2. Part 2: Genetic Algorithm Implementation
  3. Getting Started
  4. License
  5. Acknowledgements

Part 1: Implementing Neural Networks with PyTorch

Task 1: Digit Recognition with Fully Connected Neural Networks

Complete the linear-mnist.ipynb file

Task 2: Digit Recognition with Convolutional Neural Networks

Complete the cnn-mnist.ipynb file

Task 3: Brain Tumor Detection

This dataset contains images of brains with four labels (no tumor and three types of tumors). You will use transfer learning with the ResNet50 model. Complete the Project_Tumor.ipynb

Part 2: Genetic Algorithm Implementation

This section contains a Jupyter Notebook that implements a genetic algorithm. The key components of the algorithm include:

Functions Overview

  • create_individual(): Creates a random chromosome.
  • generate_population(population_size): Generates an initial population of individuals.
  • parent_selection(population): Selects pairs of parents from the population.
  • next_generation_selection(children_population): Chooses the next generation from the children population.
  • crossover(parents): Implements the crossover algorithm to produce offspring.
  • mutate(seq): Implements mutation on a sequence.
  • fitness_score(seq): Calculates the fitness score of an individual.
  • population_fitness(population): Calculates the total fitness of the population.
  • check_end(population): Checks if the algorithm should terminate.

Getting Started

To get started, clone or fork the repository and follow the instructions in the respective files to complete the tasks. Make sure to install the required libraries, especially PyTorch for the neural network tasks and Matplotlib for visualization.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

About

This repository contains two subprojects focused on neural networks and a genetic algorithm. The first part involves implementing neural networks using PyTorch, while the second part focuses on developing a genetic algorithm to solve optimization problems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published