Skip to main content

Toolkit for building Keras models with the help of GPT

Project description

GPTkeras

GPTkeras aims to solve the struggles of guessing model configurations and hyperparameters when developing machine learning projects. Instead of manually tuning architectures and settings, you simply provide your training data (x and y), and this library leverages large language models (LLMs) specifically ChatGPT to automatically generate suitable layers and hyperparameters for your dataset.

The workflow is as follows:

  • You provide your training data.
  • The library uses ChatGPT to draft a Keras model architecture and select hyperparameters tailored to your data.
  • It runs a training session and evaluates the results.
  • The training results are then passed back to the LLM, which attempts to further improve the model configuration in subsequent iterations.

Another major challenge in machine learning experimentation is tracking changes to models and understanding how those changes affect results. GPTkeras addresses this by using the LLM to log and manage conversational context, so you can see how each modification impacts performance over time.

This toolkit wraps the OpenAI Chat Completions API and provides helpers for drafting model architectures, managing experiments, and logging conversational context when iterating on training runs.

Installation

pip install GPTkeras

Quick start

from GPTkeras import GPTkeras

model = GPTkeras(train_x, train_y, api_key="sk-...")
model.fit(max_iterations=3)

Documentation

GPTkeras Arguments

GPTkeras(
	train_x,                      # Required. Training input data (numpy array or tensor)
	train_y,                      # Required. Training target data (numpy array or tensor)
	api_key=None,                 # Required. OpenAI API key for LLM access
	model="gpt-4o-mini",         # Optional. OpenAI model name (default: "gpt-4o-mini")
	history_path="chat_history.jsonl", # Optional. Path to log conversational/model history (default: "chat_history.jsonl")
	continue_from_history=False,  # Optional. If True, resumes conversation/model history from previous runs (default: False)
)

Contributing

Contributions, suggestions, and bug reports are welcome! Feel free to open issues or submit pull requests to help improve GPTkeras.

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

gptkeras-0.0.2.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

gptkeras-0.0.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file gptkeras-0.0.2.tar.gz.

File metadata

  • Download URL: gptkeras-0.0.2.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for gptkeras-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2fea5fed73459b9af7c175395ff2b2fcf727f0c75ce7b8f4e110814f4f3faac5
MD5 f043ececfeb402c0d2ec85169e006008
BLAKE2b-256 44a8f122d6d57f943b9f42dc07593979b554b34d27967723c012701fa8f6957b

See more details on using hashes here.

File details

Details for the file gptkeras-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: gptkeras-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for gptkeras-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 73b1bdb3b9d055eaf030a2a1f4b66916a4d669c84f5e457a00254d9199610162
MD5 a58324be292389e6c15f25dd03a3d0b9
BLAKE2b-256 2b16090bf4c7f024342effe57fb03c83490fd2a287c988740617e8be4b822dc9

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