Instructions to use ReasoningKingdom/LITOperator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LeRobot
How to use ReasoningKingdom/LITOperator with LeRobot:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Remove the local Particles project
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748#!/usr/bin/env python3"""potentials.py — random convex scalar potential fields.
The most ordinary convex model:
V(q) = 1/2 (q-c)^T A (q-c), A PSD
The convex certificate is the PSD spectrum of A: every eigenvalue >= 0.The global minimum is V=0 at c (and on c + null(A) when A is singular)."""import numpy as np
class ConvexField: def __init__(self, dim=2, seed=0, lmax=2.0): rng = np.random.default_rng(seed) self.dim = int(dim) self.seed = int(seed) self.c = rng.uniform(-1.0, 1.0, size=self.dim) q, _ = np.linalg.qr(rng.normal(size=(self.dim, self.dim))) lam = rng.uniform(0.0, lmax, size=self.dim) self.A = (q * lam) @ q.T
def V(self, x): z = np.asarray(x, dtype=float) - self.c return float(0.5 * z @ self.A @ z)
def grad(self, x): return self.A @ (np.asarray(x, dtype=float) - self.c)
def minimum(self): return self.c.copy(), 0.0
def smoothness(self): return float(np.linalg.eigvalsh(self.A).max())
def certificate(self): eig = np.linalg.eigvalsh(self.A) return { "convex": bool(eig.min() >= -1e-9), "eig_min": float(eig.min()), "eig_max": float(eig.max()), "rank": int((eig > 1e-9).sum()), "L": float(eig.max()), "min": 0.0, "dim": self.dim, "seed": self.seed, }sandbox/particles/potentials.pyDeleted-48