Skip to main content

A simple deep learning wrapper for PyTorch (RNN/GRU/LSTM/Transformer/CNN/MLP) with scikit-learn style API.

Project description

🚀 DLCore

Python PyTorch License

DLCore is a lightweight, flexible deep learning framework built on PyTorch. It allows you to train and evaluate neural networks (RNN, GRU, LSTM, Transformer, CNN) easily with minimal boilerplate code. Perfect for regression and classification tasks.


✨ Features

  • ✅ Supports RNN, GRU, LSTM, CNN, Transformer, Sequential
  • ✅ Compatible with PyTorch tensors & NumPy arrays
  • ✅ Built-in training loops, evaluation, metrics
  • Early stopping & checkpoint saving
  • ✅ Flexible metrics: MSE, MAE, R2, Accuracy, F1
  • ✅ Lightweight and easy to integrate into existing projects

📦 Installation

You can install DLCore via pip (after cloning or downloading):

git clone https://github.com/yourusername/dlcore.git
cd dlcore
pip install -r requirements.txt

🏗 Quick Start

Import DLCore

from dlcore.core import DLCore, GRU
import torch
import numpy as np

# Dummy data
X = np.random.rand(100, 10, 5)  # 100 samples, 10 timesteps, 5 features
y = np.random.rand(100, 1)      # Regression target

# Define model
model = GRU(input_size=5, hidden_size=32)

# Create DLCore trainer
trainer = DLCore(model=model, epochs=20, batch_size=16, loss_fn='mse', metrics=['mse', 'r2'])

# Train
trainer.fit(X, y)

# Predict
preds = trainer.predict(X)
print(preds[:5])

📊 Supported Metrics

Metric Task
mse Regression
mae Regression
r2 Regression
accuracy Classification
f1 Classification

🔧 Checkpoints & Early Stopping

DLCore supports:

trainer = DLCore(model=model, early_stopping=True, patience=5, checkpoint_path='best_model.pth')
  • Saves the best model automatically
  • Stops training when validation loss does not improve

💡 Examples

See the examples/ folder for ready-to-run examples:

  • rnn_example.py
  • cnn_example.py
  • transformer_example.py

📄 License

MIT License © 2025 Feel free to use, modify, and distribute DLCore in your projects.


❤️ Support / Contribute

If you enjoy DLCore, give it a ⭐ and feel free to submit pull requests or issues!


Made with ❤️ by dev_pine

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

deeplcore-0.0.1.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

deeplcore-0.0.1.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file deeplcore-0.0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for deeplcore-0.0.1.1.tar.gz
Algorithm Hash digest
SHA256 d945019f6f07b9c8a7a9a2b69a8f9d53a4d0775c147c274ae94757409fc17d88
MD5 b623fcc83cdd7ff831250aa6dbf0e4d6
BLAKE2b-256 1cb78467afa632ec5c0dd009715a2516b7051a0d8ed001ec9a87da142fce07ce

See more details on using hashes here.

File details

Details for the file deeplcore-0.0.1.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for deeplcore-0.0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b13c21b62f89b3ca53ef5d8067ddb3862c400244b2dd9483da22f4e82fc95457
MD5 fa7a73730497e7ae727ef6af50b4c080
BLAKE2b-256 64b12527d58a23aa3dca5893b25495647045e173f15e8f5b654b6139e2c563af

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