Documentation ¶
Index ¶
- func SizeLength(size []int) int
- type Stats
- type Tensor
- func (t *Tensor) Add(a ...*Tensor) error
- func (t *Tensor) AddVal(val float64, index ...int)
- func (t *Tensor) Allocate(size ...int) error
- func (t *Tensor) Copy() *Tensor
- func (t *Tensor) DimToFlat(index ...int) int
- func (t *Tensor) FlatToDim(index int) []int
- func (t *Tensor) GetDims() int
- func (t *Tensor) GetNumberOfValues() int
- func (t *Tensor) GetVal(index ...int) float64
- func (t *Tensor) HasSize(size []int) bool
- func (t *Tensor) Image(dynamicRange float64) (image.Image, error)
- func (t *Tensor) ImageSlice() ([]image.Image, error)
- func (t *Tensor) InBounds(index ...int) bool
- func (t *Tensor) Marshal(w io.Writer) error
- func (t *Tensor) Max() (int, float64)
- func (t *Tensor) MaxAbs() (int, float64)
- func (t *Tensor) Mean() float64
- func (t *Tensor) Min() (int, float64)
- func (t *Tensor) Mul(s float64)
- func (t *Tensor) SetVal(val float64, index ...int)
- func (t *Tensor) Slice(indexes ...int) *Tensor
- func (t *Tensor) Stats() *Stats
- func (t *Tensor) StdDev() float64
- func (t *Tensor) Substract(s *Tensor) error
- func (t *Tensor) Zero(val float64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Tensor ¶
type Tensor struct { Values []float64 Size []int //Size of each dimension in order. Values should be bigger than 0 // contains filtered or unexported fields }
Tensor is a structure to represent a multiple dimension matrix
func (*Tensor) DimToFlat ¶
DiToFlat returns the position in the Values slice of a value in the position given by the index.
For example in a 2x2 tensor, DimToFlat(0,0) will return 0 and DimToFlat(0,1) will return 2
func (*Tensor) GetNumberOfValues ¶
Click to show internal directories.
Click to hide internal directories.