yishape-math  by ScaleFree-Tech

Java math library delivering NumPy-like performance

Created 9 months ago
273 stars

Top 94.4% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

YiShape-Math is a high-performance Java numerical computing library designed to provide functionalities akin to Python's NumPy and SciPy. It targets Java developers requiring advanced mathematical operations, data analysis, machine learning, and scientific computing capabilities within their applications. The library offers a familiar API style, significant performance optimizations through SIMD and an optional native Rust backend, making complex computations more accessible and efficient in the Java ecosystem.

How It Works

YiShape-Math employs a Java-based architecture with APIs meticulously designed to mirror modern Python numerical libraries. Core functionalities are organized into nine facade classes (e.g., Linalg, DataFrame, ML, Stats). Performance is a key focus, achieved through Java Vector API (SIMD) for vectorized operations and an optional High-Performance Computing (HPC) mode that leverages JNI/FFM to call highly optimized Rust native libraries (like Faer and Highs). This multi-backend approach allows users to select between pure Java scalar (SISD), SIMD-accelerated, or native Rust execution without altering business logic.

Quick Start & Requirements

  • Requirements: Java 25 or higher, Maven 3.6+.
  • Installation: Add the yishape-math artifact via Maven Central or GitHub Packages. For the HPC backend, include yishape-math-hpc and ensure native libraries are accessible.
  • SIMD/HPC Execution: Enable SIMD via JVM argument --add-modules jdk.incubator.vector. For HPC, use --enable-native-access=ALL-UNNAMED.
  • Documentation: Extensive examples and API documentation are available within the repository. A Chinese textbook is in progress, with an English version to follow.

Highlighted Details

  • Performance: Claims "industrial-grade and leading performance in Java communities," with benchmarks showing substantial speedups over other Java libraries and pure Java implementations, particularly for large-scale matrix operations and decompositions via the HPC backend (3-12x faster).
  • API Design: Mimics NumPy and SciPy, facilitating adoption for developers familiar with these Python libraries.
  • Extensive Functionality: Covers core linear algebra, data frame operations, statistics (14 distributions, hypothesis testing), machine learning (regression, classification, clustering, dimensionality reduction), optimization (L-BFGS, SGD, LP solvers), signal processing, time series analysis, and vector indexing.
  • Data Visualization: Offers multiple plotting backends including JavaFx, Echarts, and SVG.
  • Distance Metric Learning: Implements a proprietary DDML algorithm and over 14 classic DML algorithms.

Maintenance & Community

The project is maintained by a consortium including research centers from UESTC, SWUFE, HAUT, and Chengdu Scale-Free Tech Ltd. Development appears active, with recent updates noted in the changelog. Primary community interaction and issue reporting are handled via GitHub Issues.

Licensing & Compatibility

YiShape-Math is released under the permissive MIT License. This license allows for free use, modification, distribution, and commercialization, provided the original copyright and license notice are retained. It is compatible with closed-source applications.

Limitations & Caveats

The library requires a very recent Java version (25). The high-performance HPC backend, while offering significant speedups, is optional and necessitates additional setup and JVM arguments. GPU acceleration has been temporarily removed. While examples are plentiful, comprehensive English documentation beyond the README is still under development.

Health Check
Last Commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
26 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.