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.
- Part 1: Implementing Neural Networks with PyTorch
- Part 2: Genetic Algorithm Implementation
- Getting Started
- License
- Acknowledgements
Complete the linear-mnist.ipynb
file
Complete the cnn-mnist.ipynb
file
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
This section contains a Jupyter Notebook that implements a genetic algorithm. The key components of the algorithm include:
- 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.
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.
This project is licensed under the MIT License - see the LICENSE file for details.