A comprehensive Python library for mathematical optimization, deep learning, computer vision, and classic algorithms. This library is designed with a dual-backend architecture, offering seamless switching between NumPy for transparency and PyTorch for hardware acceleration and automatic differentiation.
vicentin is a Python package that contains my personal implementations of a variety of algorithms, data structures, and optimization techniques. It serves as a collection of theoretical and practical programming concepts.
- Data Structures: Queue, Stack, Tree, Graph, Heap, Priority Queue, Trie, Union Find
- Dynamic Programming: Knapsack, Matrix Multiplication, Rod Cutting, Edit Distance
- Graph Algorithms: Minimum Spanning Tree (MST), Shortest Path, Negative Cycle Detection
- Image & Video Processing: Optical Flow (Horn-Schunck), Differentiation, Regularization, Image-to-Graph
- Optimization: Gradient Descent, Newton's Method, Barrier Method, Proximal Gradient Descent, ISTA, Projected Gradient Descent, Newton-Raphson (Root Finding)
- Deep Learning:
- Models: Autoencoders (AE), Variational Autoencoders (VAE)
- Trainers: Standard, Supervised, GAN, Distillation
- Losses: Beta-VAE, Wasserstein GAN
- Sorting: Heap Sort
- Mathematical Tools: Polynomial Operations
git clone https://github.com/your-username/vicentin.git
cd vicentinpython -m venv venv
source venv/bin/activatepip install -r requirements.txt# Example: Using the heap data structure
from vicentin.data_structures.heap import Heap
heap = Heap()
heap.insert(5)
heap.insert(2)
heap.insert(8)
print(heap.extract_min()) # Output: 2import torch
from vicentin.optimization.minimization import newton_method
def objective(x):
return torch.sum(x**2)
x0 = torch.tensor([10.0, 10.0])
A = torch.tensor([[1.0, 1.0]])
b = torch.tensor([1.0])
# Backend (Torch) is automatically detected from x0
x_opt = newton_method(objective, x0, equality=(A, b))
print(f"Optimal solution: {x_opt}")This repository uses pre-commit to enforce coding standards, automatic formatting and automatic version bumping before commits.
pip install pre-commitpre-commit install3️⃣ Use commitizen to commit
cz commitThis project is licensed under the MIT License.