Skip to content

Vinschers/algorithms

Repository files navigation

Vicentin

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.

CI License: MIT PyPI - Version


Table of Contents


Introduction

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.


Features


Installation

1️⃣ Clone the Repository

git clone https://github.com/your-username/vicentin.git
cd vicentin

2️⃣ Set Up a Virtual Environment

python -m venv venv
source venv/bin/activate

3️⃣ Install Dependencies

pip install -r requirements.txt

Usage

Heap data structure

# 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: 2

Newton's Method

import 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}")

Pre-commit Setup

This repository uses pre-commit to enforce coding standards, automatic formatting and automatic version bumping before commits.

1️⃣ Install pre-commit

pip install pre-commit

2️⃣ Install Hooks

pre-commit install

3️⃣ Use commitizen to commit

cz commit

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages