matrex v0.6.3 Matrex.Operators View Source

Overrides Kernel math operators and adds common math functions shortcuts for use with matrices. Use with caution.

Usage

iex> import IEx.Helpers, except: [t: 1] # Only in iex, conflicts with transpose function
iex> import Matrex.Operators
iex> import Kernel, except: [-: 1, +: 2, -: 2, *: 2, /: 2, <|>: 2]
iex> import Matrex

iex> m = random(5, 3)
#Matrex[5×3]
┌                         ┐
│ 0.51502 0.03132 0.94185 │
│ 0.49434 0.93887 0.91102 │
│ 0.70671 0.89428 0.28817 │
│ 0.23771 0.37695 0.38214 │
│ 0.37221 0.34008 0.19615 │
└                         ┘
iex> m * t(m) / eye(5) |> sigmoid()
#Matrex[5×5]
┌                                         ┐
│ 0.76012     1.0     1.0     1.0     1.0 │
│     1.0 0.87608     1.0     1.0     1.0 │
│     1.0     1.0 0.79935     1.0     1.0 │
│     1.0     1.0     1.0 0.58531     1.0 │
│     1.0     1.0     1.0     1.0 0.57265 │
└                                         ┘

Link to this section Summary

Functions

Element-wise matrices multiplication. The same as Matrex.multiply/2

Applies C language abs(x) to each element of the matrix. See Matrex.apply/2

Applies C language acos(x) to each element of the matrix. See Matrex.apply/2

Applies C language acosh(x) to each element of the matrix. See Matrex.apply/2

Applies C language asin(x) to each element of the matrix. See Matrex.apply/2

Applies C language asinh(x) to each element of the matrix. See Matrex.apply/2

Applies C language atan(x) to each element of the matrix. See Matrex.apply/2

Applies C language atanh(x) to each element of the matrix. See Matrex.apply/2

Applies C language cbrt(x) to each element of the matrix. See Matrex.apply/2

Applies C language ceil(x) to each element of the matrix. See Matrex.apply/2

Applies C language cos(x) to each element of the matrix. See Matrex.apply/2

Applies C language cosh(x) to each element of the matrix. See Matrex.apply/2

Applies C language erf(x) to each element of the matrix. See Matrex.apply/2

Applies C language erfc(x) to each element of the matrix. See Matrex.apply/2

Applies C language exp(x) to each element of the matrix. See Matrex.apply/2

Applies C language exp2(x) to each element of the matrix. See Matrex.apply/2

Applies C language expm1(x) to each element of the matrix. See Matrex.apply/2

Applies C language floor(x) to each element of the matrix. See Matrex.apply/2

Applies C language lgamma(x) to each element of the matrix. See Matrex.apply/2

Applies C language log(x) to each element of the matrix. See Matrex.apply/2

Applies C language log2(x) to each element of the matrix. See Matrex.apply/2

Applies C language round(x) to each element of the matrix. See Matrex.apply/2

Applies C language sigmoid(x) to each element of the matrix. See Matrex.apply/2

Applies C language sin(x) to each element of the matrix. See Matrex.apply/2

Applies C language sinh(x) to each element of the matrix. See Matrex.apply/2

Applies C language sqrt(x) to each element of the matrix. See Matrex.apply/2

Transpose a matrix

Applies C language tan(x) to each element of the matrix. See Matrex.apply/2

Applies C language tanh(x) to each element of the matrix. See Matrex.apply/2

Applies C language tgamma(x) to each element of the matrix. See Matrex.apply/2

Applies C language truncate(x) to each element of the matrix. See Matrex.apply/2

Link to this section Functions

Element-wise matrices multiplication. The same as Matrex.multiply/2

Applies C language abs(x) to each element of the matrix. See Matrex.apply/2

Applies C language acos(x) to each element of the matrix. See Matrex.apply/2

Applies C language acosh(x) to each element of the matrix. See Matrex.apply/2

Applies C language asin(x) to each element of the matrix. See Matrex.apply/2

Applies C language asinh(x) to each element of the matrix. See Matrex.apply/2

Applies C language atan(x) to each element of the matrix. See Matrex.apply/2

Applies C language atanh(x) to each element of the matrix. See Matrex.apply/2

Applies C language cbrt(x) to each element of the matrix. See Matrex.apply/2

Applies C language ceil(x) to each element of the matrix. See Matrex.apply/2

Applies C language cos(x) to each element of the matrix. See Matrex.apply/2

Applies C language cosh(x) to each element of the matrix. See Matrex.apply/2

Applies C language erf(x) to each element of the matrix. See Matrex.apply/2

Applies C language erfc(x) to each element of the matrix. See Matrex.apply/2

Applies C language exp(x) to each element of the matrix. See Matrex.apply/2

Applies C language exp2(x) to each element of the matrix. See Matrex.apply/2

Applies C language expm1(x) to each element of the matrix. See Matrex.apply/2

Applies C language floor(x) to each element of the matrix. See Matrex.apply/2

Applies C language lgamma(x) to each element of the matrix. See Matrex.apply/2

Applies C language log(x) to each element of the matrix. See Matrex.apply/2

Applies C language log2(x) to each element of the matrix. See Matrex.apply/2

Applies C language round(x) to each element of the matrix. See Matrex.apply/2

Applies C language sigmoid(x) to each element of the matrix. See Matrex.apply/2

Applies C language sin(x) to each element of the matrix. See Matrex.apply/2

Applies C language sinh(x) to each element of the matrix. See Matrex.apply/2

Applies C language sqrt(x) to each element of the matrix. See Matrex.apply/2

Transpose a matrix.

Applies C language tan(x) to each element of the matrix. See Matrex.apply/2

Applies C language tanh(x) to each element of the matrix. See Matrex.apply/2

Applies C language tgamma(x) to each element of the matrix. See Matrex.apply/2

Applies C language truncate(x) to each element of the matrix. See Matrex.apply/2