tensor

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2020 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrDimensionsAreNotEqual For Hadamard product
	ErrDimensionsAreNotEqual = fmt.Errorf("Tensors' dimensions are not equal")
	// ErrDimensionsNotFit For matrix multiplication
	ErrDimensionsNotFit = fmt.Errorf("Tensors have incompatible dimensions")
	// ErrKernelZAxis Kernel may have Z = 1 only (in convolution between matrix and kernel).
	ErrKernelZAxis = fmt.Errorf("Kernel size should be defined as (Any X, Any Y, 1)")
)

Functions

This section is empty.

Types

type ConvLayer

type ConvLayer struct {
	In         *Tensor
	Out        *Tensor
	Kernels    []*Tensor
	KernelSize int
	Stride     int
}

ConvLayer @DEPRECATED Struct of convolutional layer

func NewConvolveLayer

func NewConvolveLayer(insizeX, insizeY, insizeZ, numberFilters, kernelSize, stride int) *ConvLayer

NewConvolveLayer @DEPRECATED Constructor for convolutional layer

func (*ConvLayer) NaiveConv

func (conv *ConvLayer) NaiveConv()

NaiveConv @DEPRECATED Forward pass for convolutional layer

type Point

type Point struct {
	X int `json:"X"`
	Y int `json:"Y"`
	Z int `json:"Z"`
}

Point Dimensions

type TDsize

type TDsize = Point

TDsize Alias to Point

func (*TDsize) Total

func (td *TDsize) Total() int

Total Returns total number of elements

type Tensor

type Tensor struct {
	Data []float64
	Size *Point
}

Tensor @DEPRECATED Struct of 3-d tensor

func NewTensor

func NewTensor(x, y, z int) *Tensor

NewTensor @DEPRECATED Constructor for 3-d tensor

func (*Tensor) Get

func (t *Tensor) Get(x, y, z int) float64

Get @DEPRECATED Returns value of for x-y-z-th element

func (*Tensor) Set

func (t *Tensor) Set(x, y, z int, val float64)

Set @DEPRECATED Sets value for x-y-z-th element

Jump to

Keyboard shortcuts

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