Skip to main content

LLM-Based Neural Network Generator

Project description

GPT-Driven Neural Network Generator


short alias lmurg

Overview 📖

This Python-based project leverages large language models to automate the creation of neural network architectures, streamlining the design process for machine learning practitioners.

Create and Activate a Virtual Environment (recommended)

For Linux/Mac:

python3 -m venv .venv
source .venv/bin/activate

For Windows:

python3 -m venv .venv
.venv\Scripts\activate

All subsequent commands are provided for Linux/Mac OS. For Windows, please replace source .venv/bin/activate with .venv\Scripts\activate. It is also assumed that CUDA 12.6 is installed. If you have a different version, please replace 'cu126' with the appropriate version number.

Environment for NNGPT Developers

Pip package manager

Prerequisites for mpi4py package:

  • On Debian/Ubuntu systems, run:

       sudo apt install libmpich-dev    # for MPICH
    
       sudo apt install libopenmpi-dev  # for Open MPI
    
  • On Fedora/RHEL systems, run:

       sudo dnf install mpich-devel     # for MPICH
    
       sudo dnf install openmpi-devel   # for Open MPI
    

Create a virtual environment, activate it, and run the following command to install all the project dependencies:

source .venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu126

Update of NN Dataset

Remove old version of the LEMUR Dataset and its database:

source .venv/bin/activate
pip uninstall nn-dataset -y
rm -rf db

Installing the stable version:

source .venv/bin/activate
pip install nn-dataset --upgrade --extra-index-url https://download.pytorch.org/whl/cu126

Installing from GitHub to get the most recent code and statistics updates:

source .venv/bin/activate
pip install git+https://github.com/ABrain-One/nn-dataset --upgrade --force --extra-index-url https://download.pytorch.org/whl/cu126

Adding functionality to export data to Excel files and generate plots for analyzing neural network performance:

source .venv/bin/activate
pip install nn-stat --upgrade --extra-index-url https://download.pytorch.org/whl/cu126

and export/generate:

source .venv/bin/activate
python -m ab.stat.export

Docker

All versions of this project are compatible with AI Linux and can be run inside a Docker image:

docker run -v /a/mm:. abrainone/ai-linux bash -c "PYTHONPATH=/a/mm python -m ab.gpt.train_n_eval"

The recently added dependencies might be missing in the AI Linux. In this case, you can create a container from the Docker image abrainone/ai-linux, install the missing packages (preferably using pip install <package name>), and then create a new image from the container using docker commit <container name> <new image name>. You can use this new image locally or push it to the registry for deployment on the computer cluster.

Usage

Use initial_generation_chg.py to generate initial modified CV models, specify by argument -e to determine the number of epochs for initial CV model generation.

Use finetune_nn_gen.py to perform generation and evaluation of CV model, evaluate and fine-tune the LLM. Use argument -s to colaborate with generate.py, with -s for number of epochs to skip the CV model generation.

Pretrained LLM weights

Citation

The original version of this project was created at the Computer Vision Laboratory of the University of Würzburg by the authors mentioned below. If you find this project to be useful for your research, please consider citing:

@misc{ABrain-One.NNGPT,
  author       = {Qin, Furui and Kochnev, Roman and Khalid, Waleed and Goodarzi, Arash Torabi and Zhang, Xi and Dhameliya, Yashkumar Sanjaybhai and Ignatov, Dmitry and Timofte, Radu},
  title        = {GPT-Driven Neural Network Generator},
  howpublished = {\url{https://github.com/ABrain-One/nn-gpt}},
  year         = {2024},
}

Licenses

This project is distributed under the following licensing terms:

  • models with pretrained weights under the legacy DeepSeek LLM V2 license
  • all neural network models and their weights not covered by the above licenses, as well as all other files and assets in this project, are subject to the MIT license

The idea and leadership of Dr. Ignatov

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

nn_gpt-0.1.0.tar.gz (34.6 kB view details)

Uploaded Source

Built Distribution

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

nn_gpt-0.1.0-py3-none-any.whl (45.0 kB view details)

Uploaded Python 3

File details

Details for the file nn_gpt-0.1.0.tar.gz.

File metadata

  • Download URL: nn_gpt-0.1.0.tar.gz
  • Upload date:
  • Size: 34.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for nn_gpt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8b8f9f8f94a13d476524f20df9c6159727881cc7a0feea8fc9ab14cad08d2aa9
MD5 087df795791cfed2d723ccdd0db64c96
BLAKE2b-256 d171d4dde50be9efea946c8072a2d32d22729b1ee723a095f8f5bbc47e11579b

See more details on using hashes here.

File details

Details for the file nn_gpt-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nn_gpt-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 45.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for nn_gpt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ea41ddeac93c0b89d65bee48d268f65bbb903fc3326f2e91c95998e8f4dc805
MD5 7e8b7c76520e43b03a611510c5091c83
BLAKE2b-256 2463bc554c2bdf5c08e5d3be35702c0d6d04de93222d7cbff0082a0d8bedb813

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