Skip to main content

AlphaNetworks

PyPI Version Python Versions License

AlphaNetworks is a Python package designed to train advanced image classification models using hybrid architectures like ResNet50V2 and DenseNet169. It provides custom deep learning layers and blocks, such as the MoEBlock, MLABlock, and AlphaBlocks, to enhance flexibility and performance.


Table of Contents


Introduction

AlphaNetworks combines state-of-the-art architectures with custom deep learning layers to offer superior performance in image classification tasks. By leveraging pre-trained weights, advanced optimization techniques, and flexible blocks, it ensures robust feature extraction and better generalization.


Features

  • Custom Layers: Includes MoEBlock, MLABlock, and AlphaBlocks for advanced deep learning models.
  • Hybrid Architecture: Integrates ResNet50V2 and DenseNet169.
  • Data Augmentation: Enhances model robustness.
  • CLI Support: Train and configure models via the command line.
  • Customizable Hyperparameters: Adjust learning rate, batch size, etc.
  • Download Pretrained Weights: Automatically fetch required weights.

Installation

Prerequisites

  • Python: Version 3.6 or higher.
  • TensorFlow: Version 2.x or later.
  • pip: Latest version recommended.

Installation via Pip

Install AlphaNetworks directly from PyPI:

pip install alphanetworks

Usage

Command-Line Interface

Basic Usage

alphanetworks-train --train_dir TRAIN --val_dir VAL [OPTIONS]

Options

  • --train_dir or -t: Path to the training dataset.
  • --val_dir or -v: Path to the validation dataset.
  • --epochs or -e: Number of training epochs (default: 50).
  • --batch_size or -b: Batch size for training and validation (default: 8).
  • --learning_rate or -lr: Initial learning rate for the Adam optimizer (default: 0.0001).
  • --num_classes or -nc: Number of target classes for classification (default: 10).
  • --output_dir or -o: Directory to save model weights and reports (default: ./output).

Help

For a detailed list of options, run:

alphanetworks-train --help

Examples

Example 1: Basic Training

alphanetworks-train --train_dir ./data/train --val_dir ./data/val --epochs 20

Example 2: Custom Parameters

alphanetworks-train --train_dir ./data/train --val_dir ./data/val --epochs 50   --batch_size 16 --learning_rate 0.0005 --num_classes 20 --output_dir ./models

Programmatic Usage

from alphanetworks import build_model

# Build the model
model = build_model(input_shape=(224, 224, 3), num_classes=10)

# Compile the model
model.compile(
    optimizer="adam",
    loss="categorical_crossentropy",
    metrics=["accuracy"]
)

# Train the model
model.fit(train_data, validation_data=val_data, epochs=30)

Troubleshooting

Download Errors

During runtime, pre-trained weights for ResNet50V2 or DenseNet169 are automatically downloaded. Ensure you have a stable internet connection.


Project Structure

alphanetworks/
├── alphanetworks/
│   ├── __init__.py
│   ├── layers.py
│   ├── models.py
├── scripts/
│   └── train_model.py
├── setup.py
├── LICENSE
├── README.md

Documentation

For detailed documentation, visit the GitHub repository.


Contributing

Contributions are welcome! Please submit a pull request or open an issue.


License

This project is licensed under the MIT License.


Contact

For any queries, reach out to the author at mail.


Acknowledgments

  • TensorFlow and Keras Teams
  • Researchers of ResNet and DenseNet

Metadata

Release files for alphanetworks 0.3.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for alphanetworks 0.3.5
File Size Uploaded
alphanetworks-0.3.5.tar.gz 8.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for alphanetworks 0.3.5
File Interpreter ABI Platform
alphanetworks-0.3.5-py3-none-any.whl Python 3 none any Details

Total release size: 17.9 kB

Release files / alphanetworks-0.3.5.tar.gz

Download URL alphanetworks-0.3.5.tar.gz
Size 8.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2b539d1d652f4f5258dfee9136a14948b7da3fa53f80e74433cc00b7c515227a
BLAKE2b-256 checksum
How to use checksums
bb040d1d14bae8fc5275d1a31c9a60ffb53683decb90fe23d9e97607578d5972
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.11

Release files / alphanetworks-0.3.5-py3-none-any.whl

Download URL alphanetworks-0.3.5-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba313c6e8645a628c3b18d3a673bf3d367e8706b492ab2439ea0e540eb6798b4
BLAKE2b-256 checksum
How to use checksums
971faf4327e62974f4fb43737408b946d92620518431b7caf66dd46c126e92fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.10.11

Release history Release notifications | RSS feed

This release

0.3.5 This release

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.0

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page