mat

package
v0.0.0-...-a6366f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2018 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SumCols

func SumCols(m Matrix) vec.Vector

SumCols sums the columns of the given matrix and returns the sum vector

Types

type Matrix

type Matrix struct {
	// contains filtered or unexported fields
}

Matrix Matrix

func Copy

func Copy(from Matrix) Matrix

Copy returns a copy of the given Matrix

func InitCols

func InitCols(cols ...vec.Vector) Matrix

InitCols initializes a Matrix with given col vectors

func InitFromStringArray

func InitFromStringArray(s [][]string) Matrix

InitFromStringArray initilizes an array from a 2D array of strings

func InitRows

func InitRows(rows ...vec.Vector) Matrix

InitRows initializes a Matrix with given row vectors

func Make

func Make(i, j int) Matrix

Make initializes a matrix with i rows and j cols

func Mul

func Mul(m1, m2 Matrix) Matrix

Mul performs the matrix multiplication m1 x m2

func Slice

func Slice(m Matrix, from, to int) Matrix

Slice returns a slice of the Matrix

func Sub

func Sub(m1, m2 Matrix) Matrix

Sub subtracts the two matrices and returns the result

func Transpose

func Transpose(m Matrix) Matrix

Transpose copies and transposes the given matrix

func (Matrix) AddCol

func (m Matrix) AddCol(col vec.Vector)

AddCol adds the given vector to each column vector

func (*Matrix) Append

func (m *Matrix) Append(v vec.Vector, axis int)

func (Matrix) At

func (m Matrix) At(i, j int) float64

At returns the element at the ith row and jth column

func (Matrix) Col

func (m Matrix) Col(i int) vec.Vector

Col returns the ith column

func (Matrix) ColCount

func (m Matrix) ColCount() int

ColCount returns the Matrix column count

func (*Matrix) Drop

func (m *Matrix) Drop(index, axis int)

func (Matrix) Mul

func (m Matrix) Mul(other Matrix)

Mul does the element wise multiplication with the given matrix

func (Matrix) Pow

func (m Matrix) Pow(f float64)

Pow applies the power operation to each element

func (Matrix) ReLU

func (m Matrix) ReLU()

ReLU applies the ReLU function to each element

func (Matrix) ReLUDer

func (m Matrix) ReLUDer()

ReLUDer applies the ReLU derivative to each element

func (Matrix) Row

func (m Matrix) Row(i int) vec.Vector

func (Matrix) RowCount

func (m Matrix) RowCount() int

RowCount returns the Matrix row count

func (Matrix) Scale

func (m Matrix) Scale(f float64)

Scale scales every element by the given float

func (Matrix) Set

func (m Matrix) Set(i, j int, f float64)

Set sets the number at the ith row & jth column to the given number

func (Matrix) Sigmoid

func (m Matrix) Sigmoid()

Sigmoid applies the sigmoid function to each element

func (Matrix) SigmoidDer

func (m Matrix) SigmoidDer()

SigmoidDer applies the sigmoid derivative to each element

func (Matrix) String

func (m Matrix) String() string

func (Matrix) Sub

func (m Matrix) Sub(other Matrix)

Sub does the element wise subtraction with the given matrix

func (Matrix) SwapCols

func (m Matrix) SwapCols(i, j int)

SwapCols swaps the ith and jth columns

func (*Matrix) Transpose

func (m *Matrix) Transpose()

Transpose transposes the matrix

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL