Repository navigation
Conversation
… under docs/ - Array layout: NumPy, Rust, C and C++ share row-major features (n, d), weights (num_classes, d) and duals (n, num_classes), read and written in place without copies. C++ make_input_feature(n, d, X) and make_input_kernel(n, n_train, K) take the number of examples first. - Scores: sdca_model_scores (C), sdca::batch_scores (C++) and Rust's Model::decision_function compute a batch of scores with one BLAS gemm. - Docs: the Python, PyTorch, JAX and Rust guides move to docs/; dense paragraphs become short paragraphs, bullets and tables; API.md and CPP.md document the projections and proximal operators; links to the technical report carry no anchors or table numbers. - tools/check_docs.py checks local links, heading anchors and GitHub math, and runs in quality.py.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes for the unreleased 0.4.0, on top of
master.One array layout
NumPy, Rust, C and C++ now describe the same memory the same way, and the native library reads and writes the caller's buffers in place, without copies.
(n, d)center(num_classes, d): one weight vector per class(n, num_classes)Model.weightsandcenterwere Fortran-ordered(d, num_classes); they are C-ordered(num_classes, d).SDCAClassifier.coef_is unchanged.(d, num_classes);Start::centeris passed as given.make_input_feature(n, d, X)andmake_input_kernel(n, n_train, K)take the number of examples first (they took it second).docs/API.md states the layout once.
Batch scores through BLAS
sdca_model_scores(C) andsdca::batch_scores(C++) compute the(n, num_classes)scores of a feature or kernel batch with onegemm.Model::decision_functioncalls it instead of looping over examples and classes.A' Bcase through contiguous dot products.Documentation
docs/(PYTHON.md,TORCH.md,JAX.md,RUST.md); the package and crate readmes point there.sdca/prox.hin docs/API.md and docs/CPP.md, and thematsdca_proxoptions in docs/MATLAB.md.tools/check_docs.pychecks local Markdown links, heading anchors and GitHub math, rejects report anchors, and runs intools/quality.py.Tests
sdca_model_scoresagainst plain loops, its argument validation, and the extent and BLAS-dimension overflow checks.batch_scoresfor features and kernels in both precisions, with the built-in and an external BLAS.decision_functionequals the product with the class rows; the consumer crate checks the scores against plain loops.Validation
Linux x86_64 (AVX2)
tools/quality.py(clang-format, ruff, basedpyright, complexity, docs check)macOS arm64
Not covered locally: the Rust consumer crate against OpenBLAS and BLIS (the Rust (BLAS) job covers it), and a scores call with more than 2^31 entries.