Skip to content

Commit 5202edd

Browse files
authored
Merge pull request #2 from JulianKarlBauer/formal_aspects_paper
Formal aspects paper
2 parents 61bd532 + 8cd5ce6 commit 5202edd

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

paper.bib

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@article{Airola2018,
22
author={Airola, Antti and Pahikkala, Tapio},
33
journal={IEEE Transactions on Neural Networks and Learning Systems},
4-
title={Fast Kronecker Product Kernel Methods via Generalized Vec Trick},
4+
title={Fast {K}ronecker Product Kernel Methods via Generalized Vec Trick},
55
year={2018},
66
volume={29},
77
number={8},
@@ -11,7 +11,7 @@ @article{Airola2018
1111
}
1212

1313
@article{loan2000,
14-
title = {The ubiquitous Kronecker product},
14+
title = {The ubiquitous {K}ronecker product},
1515
journal = {Journal of Computational and Applied Mathematics},
1616
volume = {123},
1717
number = {1},
@@ -26,7 +26,7 @@ @article{loan2000
2626

2727
@misc{Schacke2013,
2828
author = {Kathrin Schäcke},
29-
title = {On the Kronecker product},
29+
title = {On the {K}ronecker product},
3030
year = {2013},
3131
}
3232

@@ -77,7 +77,7 @@ @article{Ravasi2020
7777
}
7878

7979
@inproceedings{Stock2020,
80-
title={A general-purpose toolbox for efficient Kronecker-based learning},
80+
title={A general-purpose toolbox for efficient {K}ronecker-based learning},
8181
author={Michiel Stock and Tapio Pahikkala and Antti Airola and Bernard De Baets},
8282
doi={10.21105/jcon.00015},
8383
url={https://doi.org/10.21105/jcon.00015},
@@ -184,7 +184,7 @@ @article{Buis1996
184184

185185
@article{Fackler2019,
186186
author = {Fackler, Paul L.},
187-
title = {Algorithm 993: Efficient Computation with Kronecker Products},
187+
title = {Algorithm 993: Efficient Computation with {K}ronecker Products},
188188
year = {2019},
189189
issue_date = {June 2019},
190190
publisher = {Association for Computing Machinery},

paper.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@ $$
3737
\mathbf{A}_{1,1} \mathbf{B} & \dots & \mathbf{A}_{1,n} \mathbf{B} \\
3838
\vdots & \ddots & \vdots \\
3939
\mathbf{A}_{n,1} \mathbf{B} & \dots & \mathbf{A}_{n,n} \mathbf{B}
40-
\end{bmatrix}
40+
\end{bmatrix}.
4141
$$
4242

4343
The resultant operator has shape $(nm \times nm)$ and, as such, can act on vectors of length $nm$. The Kronecker sum of $\mathbf{A}$ and $\mathbf{B}$, denoted $\mathbf{A} \oplus \mathbf{B}$ can be defined in terms of the Kronecker product as
4444
$$
45-
\mathbf{A} \oplus \mathbf{B} = \mathbf{A} \otimes \mathbf{I}_m + \mathbf{I}_n \otimes \mathbf{B}
45+
\mathbf{A} \oplus \mathbf{B} = \mathbf{A} \otimes \mathbf{I}_m + \mathbf{I}_n \otimes \mathbf{B},
4646
$$
4747
where $\mathbf{I}_d$ is the $d$-dimensional identity matrix, resulting in an operator of the same size as $\mathbf{A} \otimes \mathbf{B}$. By applying these definitions recursively, the Kronecker product or sum of more than two matrices can also be defined. In general, the Kronecker product/sum of $k$ square matrices $\{ \mathbf{A}^{(i)} \}_{i=1}^k$, with shapes $\{n_i \times n_i\}_{i=1}^k$ can be written respectively as
4848
$$
4949
\bigotimes_{i=1}^k \mathbf{A}^{(i)} = \mathbf{A}^{(1)} \otimes \mathbf{A}^{(2)} \otimes \dots \otimes \mathbf{A}^{(k)}
5050
$$
5151
and
5252
$$
53-
\bigoplus_{i=1}^k \mathbf{A}^{(i)} = \mathbf{A}^{(1)} \oplus \mathbf{A}^{(2)} \oplus \dots \oplus \mathbf{A}^{(k)}
53+
\bigoplus_{i=1}^k \mathbf{A}^{(i)} = \mathbf{A}^{(1)} \oplus \mathbf{A}^{(2)} \oplus \dots \oplus \mathbf{A}^{(k)}.
5454
$$
5555
The resultant operators can act on either vectors of length $N = \prod_{i=1}^k n_i$, or equivalently tensors of shape $(n_1, n_2, \dots n_k)$.
5656

@@ -68,7 +68,7 @@ In PyKronecker, expressions are written in terms of a high-level operator abstra
6868

6969
b) *To execute matrix-vector multiplications in a way that is maximally efficient and runs on parallel GPU/TPU hardware.*
7070

71-
Significant effort has gone into optimising the execution of matrix-vector and matrix-tensor multiplications. In particular, this comprises the kronx algorithm, Just In Time (JIT) compilation, and parallel processing on GPU/TPU hardware. As a result of this, PyKronecker is able to achieve very fast execution times compared to alternative implementations (see table 1) .
71+
Significant effort has gone into optimising the execution of matrix-vector and matrix-tensor multiplications. In particular, this comprises the kronx algorithm, Just In Time (JIT) compilation, and parallel processing on GPU/TPU hardware. As a result of this, PyKronecker is able to achieve very fast execution times compared to alternative implementations (see Table 1) .
7272

7373
c) *To allow automatic differentiation for complex loss functions involving Kronecker products.*
7474

@@ -82,7 +82,7 @@ One potential alternative in Python is the PyLops library which provides an inte
8282

8383
Another alternative is the library Kronecker.jl [@Stock2020], implemented in the Julia programming language [@bezanson2017]. Kronecker.jl has many of the same aims as PyKronecker and has a a clean interface, making use of Julia's support for unicode and infix functions to create Kronecker products with a custom $\otimes$ operator. However, at this time, the library does not support GPU acceleration or automatic differentiation, although the former is in development.
8484

85-
Table 1. shows a feature comparison of these libraries, along with the kronx algorithm implemented in "vanilla" (i.e running on the CPU without JIT compilation) NumPy. The table also shows the time to compute the multiplication of a Kronecker product against a vector in two scenarios. In the first, the Kronecker product is constructed from two of matrices of size $(400 \times 400)$ and $(500 \times 500)$, and in the second Kronecker product is constructed from three of matrices of size $(100 \times 100)$, $(150 \times 150)$ and $(200 \times 200)$ respectively. Experiments were performed with an Intel Core 2.80GHz i7-7700HQ CPU, and an Nvidia 1050Ti GPU. In both cases, PyKronecker on the GPU is the fastest by a significant margin.
85+
Table 1. shows a feature comparison of these libraries, along with the kronx algorithm implemented in "vanilla" (i.e., running on the CPU without JIT compilation) NumPy. The table also shows the time to compute the multiplication of a Kronecker product against a vector in two scenarios. In the first scenario, the Kronecker product is constructed from two matrices of size $(400 \times 400)$ and $(500 \times 500)$, and in the second scenario Kronecker product is constructed from three matrices of size $(100 \times 100)$, $(150 \times 150)$ and $(200 \times 200)$, respectively. Experiments were performed with an Intel Core 2.80GHz i7-7700HQ CPU, and an Nvidia 1050Ti GPU. In both cases, PyKronecker on the GPU is the fastest by a significant margin.
8686

8787
| Implementation | Python | Auto-diff | GPU support | Compute time (400, 500) | Compute time (100, 150, 200) |
8888
| ----------------- | ------ | --------- | ----------- | ----------------------- | ---------------------------- |
@@ -95,7 +95,7 @@ Table 1. shows a feature comparison of these libraries, along with the kronx alg
9595

9696
# Outlook and Future Work
9797

98-
There are several features that we are developing to expand the functionality of PyKronecker. The first is to provide support for non-square operators. In a typical problem, the Kronecker operators encountered represent simple linear transformations which preserve dimensionality, however, there are a significant minority of contexts where this is not the case. The inclusion of this feature would increase the range of possible applications. Secondly, we would like add support for sparse matrices. This would enable computation with larger matrices and faster execution times where applicable. However this would require integration with Jax's sparse module, which is currently under development. Finally, for convenience, it may be useful to add some commonly used algorithms such as the conjugate gradient method for solving linear systems [@shewchuk1994], least squares, and various matrix decompositions such as eigenvalue, Cholesky and LU.
98+
There are several features that we are developing to expand the functionality of PyKronecker. The first is to provide support for non-square operators. In a typical problem, the Kronecker operators encountered represent simple linear transformations which preserve dimensionality. However, there are a significant minority of contexts where this is not the case. The inclusion of this feature would increase the range of possible applications. Secondly, we would like to add support for sparse matrices. This would enable computation with larger matrices and faster execution times where applicable. However this would require integration with Jax's sparse module, which is currently under development. Finally, for convenience, it may be useful to add some commonly used algorithms such as the conjugate gradient method for solving linear systems [@shewchuk1994], least squares, and various matrix decompositions such as eigenvalue, Cholesky and LU.
9999

100100
# Acknowledgements
101101

0 commit comments

Comments
 (0)