Skip to main content

A project featuring methods for optimizing neural networks using PyTorch.

Project description

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Cartesian Genetic Programming for CNN Optimization

Project for optimizing convolutional neural networks using Cartesian genetic programming!
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. License
  5. Acknowledgments

About The Project

This project is a framework designed to streamline the optimization of convolutional neural networks (CNNs) using Cartesian Genetic Programming (CGP). It provides a structured environment that follows best practices for machine learning projects, including modularity, scalability, and easy deployment.

The project leverages a cookiecutter template, which ensures consistent structure and workflow for your projects.

You can easily fork the repository, suggest changes, or contribute to ongoing improvements!

(back to top)

Built With

This project is built using several major frameworks and libraries that streamline the development of machine learning models and help with experiment tracking and documentation. Below are the key technologies used:

  • Python
  • PyTorch
  • Jupyter
  • MLflow
  • Sphinx

(back to top)

Getting Started

To get a local copy of this project up and running, follow these simple steps.

Prerequisites

You need Python 3.10 or newer. Below are two options for setting up the environment:

  1. Using Conda:

    conda create -n cgp-cnn-env python=3.10 -y
    conda activate cgp-cnn-env
    pip install .
    
  2. Using venv:

    python -m venv cgp-cnn-env
    source cgp-cnn-env/bin/activate  # On Windows: cgp-cnn-env\Scripts\activate
    pip install .
    

For additional dependencies, install with:

pip install .[basic]  # or [dev], [doc], [all]

Alternatively, install the library directly via pip:

pip install cgp-cnn

To verify the Python version and environment setup:

python --version

Check if PyTorch can use a GPU and check the number of CPU cores available:

python -c "import os; print(os.cpu_count()); import torch; print(torch.cuda.is_available())"

Makefile Commands

make lint
make clean_linux
make generate_package
make generate_documentation
make install
make publish
make mlflow

Makefile Commands for Windows (using mingw32-make)

mingw32-make lint
mingw32-make clean_windows
mingw32-make generate_package
mingw32-make generate_documentation
mingw32-make install
mingw32-make publish
mingw32-make mlflow

SLURM Commands

https://docs.cyfronet.pl/display/~plgpawlik/Athena

module list
module avail
module load Python/3.10.4
module unload Python/3.10.4
module spider
module spider python
module spider Python/3.11.5

sinfo
scontrol show partition
scancel 873986
sbatch job.sh
squeue
scontrol show job

hpc-grants
hpc-fs
hpc-jobs
hpc-jobs-history

source ~/athena_env/bin/activate
chmod +x script.py script.sh
!!!! UTF-8 UNIX
du -sh $HOME/*
du -h --max-depth=1 $HOME
rm -rf $HOME/.cache/*
rm -rf logs/error_*.txt logs/result_*.txt

Usage

To ensure an easy introduction to the library, all examples that can be quickly executed are provided as Jupyter notebooks located in the notebooks directory. These notebooks are designed to demonstrate the functionality of the framework and guide you through the process of optimizing CNNs using Cartesian Genetic Programming.

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Acknowledgments

(back to top)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cgpcnn-0.1.2.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cgpcnn-0.1.2-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

File details

Details for the file cgpcnn-0.1.2.tar.gz.

File metadata

  • Download URL: cgpcnn-0.1.2.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for cgpcnn-0.1.2.tar.gz
Algorithm Hash digest
SHA256 ec622195ec7feb3fb051ff99af1dfee89291818ad9734c3a61ec279f32cd57b3
MD5 00d7122381863cc43fd7b3a7d65735cd
BLAKE2b-256 962cdda6db30a531616ffbbcf1b0cd1db7fb5e62c97b6ea31a978f173ab30dca

See more details on using hashes here.

File details

Details for the file cgpcnn-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cgpcnn-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 36.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for cgpcnn-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fc364236112169b949b224df7ac04e97a8e4113435e0d2d717524b43496ef17b
MD5 b7aa35ec1afc8006f64a33dce8e4d8d0
BLAKE2b-256 7155de961a47fbd9757a3e24b679df8223930c225af2d273cf4a9eae83766baa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page