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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

deeplcore-0.0.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deeplcore-0.0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68fa5d88b9cc70376009ce74edabae05a9e195aca8c84d84ee2adb81cd70a285
MD5 168bf0dccc54152ffd1d3a6e3e3307dc
BLAKE2b-256 76deda690be93c6876981a4d15da4afd3e0093003966df6e9e6a3a78288e3176

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