All Projects → bamos → Block

bamos / Block

Licence: apache-2.0
An intelligent block matrix library for numpy, PyTorch, and beyond.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Block

Numerical Linear Algebra
Free online textbook of Jupyter notebooks for fast.ai Computational Linear Algebra course
Stars: ✭ 8,263 (+3153.15%)
Mutual labels:  numpy, linear-algebra
Matrex
A blazing fast matrix library for Elixir/Erlang with C implementation using CBLAS.
Stars: ✭ 429 (+68.9%)
Mutual labels:  numpy, linear-algebra
saddle
SADDLE: Scala Data Library
Stars: ✭ 23 (-90.94%)
Mutual labels:  numpy, linear-algebra
Cython Blis
💥 Fast matrix-multiplication as a self-contained Python library – no system dependencies!
Stars: ✭ 165 (-35.04%)
Mutual labels:  numpy, linear-algebra
Curso Algebra Lineal
Curso de Álgebra Lineal
Stars: ✭ 234 (-7.87%)
Mutual labels:  linear-algebra
Static Frame
Immutable and grow-only Pandas-like DataFrames with a more explicit and consistent interface.
Stars: ✭ 217 (-14.57%)
Mutual labels:  numpy
Tutorials
AI-related tutorials. Access any of them for free → https://towardsai.net/editorial
Stars: ✭ 204 (-19.69%)
Mutual labels:  linear-algebra
Python Wechat Itchat
微信机器人,基于Python itchat接口功能实例展示:01-itchat获取微信好友或者微信群分享文章、02-itchat获取微信公众号文章、03-itchat监听微信公众号发送的文章、04 itchat监听微信群或好友撤回的消息、05 itchat获得微信好友信息以及表图对比、06 python打印出微信被删除好友、07 itchat自动回复好友、08 itchat微信好友个性签名词云图、09 itchat微信好友性别比例、10 微信群或微信好友撤回消息拦截、11 itchat微信群或好友之间转发消息
Stars: ✭ 216 (-14.96%)
Mutual labels:  numpy
Mlcpp
Set of examples of ML approaches implemented in C++
Stars: ✭ 251 (-1.18%)
Mutual labels:  linear-algebra
Rulinalg
A linear algebra library written in Rust
Stars: ✭ 247 (-2.76%)
Mutual labels:  linear-algebra
Jetson Containers
Machine Learning Containers for NVIDIA Jetson and JetPack-L4T
Stars: ✭ 223 (-12.2%)
Mutual labels:  numpy
Mathnet Numerics
Math.NET Numerics
Stars: ✭ 2,688 (+958.27%)
Mutual labels:  linear-algebra
Blasjs
Pure Javascript manually written 👌 implementation of BLAS, Many numerical software applications use BLAS computations, including Armadillo, LAPACK, LINPACK, GNU Octave, Mathematica, MATLAB, NumPy, R, and Julia.
Stars: ✭ 241 (-5.12%)
Mutual labels:  linear-algebra
Ml Feynman Experience
A collection of analytics methods implemented with Python on Google Colab
Stars: ✭ 217 (-14.57%)
Mutual labels:  numpy
Orange3
🍊 📊 💡 Orange: Interactive data analysis
Stars: ✭ 3,152 (+1140.94%)
Mutual labels:  numpy
Awesome Jax
JAX - A curated list of resources https://github.com/google/jax
Stars: ✭ 214 (-15.75%)
Mutual labels:  numpy
Pyfasttext
Yet another Python binding for fastText
Stars: ✭ 229 (-9.84%)
Mutual labels:  numpy
From 0 To Research Scientist Resources Guide
Detailed and tailored guide for undergraduate students or anybody want to dig deep into the field of AI with solid foundation.
Stars: ✭ 247 (-2.76%)
Mutual labels:  linear-algebra
Bootcamp python
Bootcamp to learn Python for Machine Learning
Stars: ✭ 228 (-10.24%)
Mutual labels:  numpy
Deeplearning cv notes
📓 deepleaning and cv notes.
Stars: ✭ 223 (-12.2%)
Mutual labels:  numpy

Block • Build Status License PyPi

An intelligent block matrix library for numpy, PyTorch, and beyond. Crafted by Brandon Amos with significant contributions by Eric Wong.


Why do we need an intelligent block matrix library?

Let's try to construct the KKT matrix from Mattingley and Boyd's CVXGEN paper in numpy and PyTorch:

Without block, there is no way to infer the appropriate sizes of the zero and identity matrix blocks. It is an inconvenience to think about what size these matrices should be.

What does block do?

Block acts a lot like np.bmat and replaces:

  • Any constant with an appropriately shaped block matrix filled with that constant.
  • The string 'I' with an appropriately shaped identity matrix.
  • The string '-I' with an appropriately shaped negated identity matrix.
  • [Request more features.]

Isn't constructing large block matrices with a lot of zeros inefficient?

Yes, block is meant to be a quick prototyping tool and there's probably a more efficient way to solve your system if it has a lot of zeros or identity elements.

How does block handle numpy and PyTorch with the same interface?

I wrote the logic to handle matrix sizing to be agnostic of the matrix library being used. numpy and PyTorch are just backends. More backends can easily be added for your favorite Python matrix library.

class Backend(metaclass=ABCMeta):

    @abstractmethod
    def extract_shape(self, x): pass

    @abstractmethod
    def build_eye(self, n): pass

    @abstractmethod
    def build_full(self, shape, fill_val): pass

    @abstractmethod
    def build(self, rows): pass

    @abstractmethod
    def is_complete(self, rows): pass

Getting Started

  • Install: pip install block
  • Usage: from block import block
  • Run tests in test.py: nosetests test.py

Issues and Contributions

I'd be happy to hear from you about any issues or features you add, please file an issue or send in a PR.

Licensing

This repository is Apache-licensed.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].