Documentation
¶
Index ¶
- func AbsoluteValue(x float32) float32
- func AddAll(data []float32, value float32)
- func CheckError(err error)
- func CompareInt(x, y []int) bool
- func CompareInt32(x, y []int32) bool
- func CopyDimsInt32(x []int32) (y []int32)
- func Dims(args ...int32) []int32
- func DivideAll(data []float32, value float32)
- func ErrorWrapper(Comment string, err error) error
- func FindAvg(data []float32) float32
- func FindFittingStride(srcdims, destdims []int32) (newsrcstrides []int32)
- func FindMax(data []float32) float32
- func FindMaxVolExtimate(pdims []int32, pmaxvol int32, cdims []int32) (outmaxvol int32)
- func FindMaxVolThroughMaxBatch(maxbatch int32, cdims []int32) (outmaxvol int32)
- func FindMin(data []float32) float32
- func FindStridesInt(dims []int) (strides []int)
- func FindStridesInt32(dims []int32) (strides []int32)
- func FindTotal(data []float32) float32
- func FindVolumeInt(dims []int) int
- func FindVolumeInt32(dims, stride []int32) int32
- func Gaussian(mean float64, std float64) float64
- func Gaussian2dKernel(sigma float32, h, w int) []float32
- func MultiplyAll(data []float32, value float32)
- func NormalGaussianVector(length int) []float32
- func NormalSortedGaussianVector(length int) []float32
- func NumbertoString(x, outof int) string
- func RandWeightSet(mean, std, ninputelements float64) float64
- func RandomFloat32(floor, ceiling float32) float32
- func RandomFloat64(floor, ceiling float64) float64
- func RandomGaussianKernelsInChannels(h, w, c int, hwc bool) []float32
- func RandomSigmaGaussian2dKernel(h, w int) []float32
- func SetAll(data []float32, value float32)
- func SetAllEx(sliceofvaltype interface{}, val interface{})
- func ToFLoat64Slice(input interface{}) []float64
- func ToFloat32Slice(input interface{}) []float32
- func ToInt32Slice(input interface{}) []int32
- func ToInt8Slice(input interface{}) []int8
- func ToUint8Slice(input interface{}) []uint8
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AbsoluteValue ¶
AbsoluteValue returns the absolutevalue in float32
func CheckError ¶
func CheckError(err error)
CheckError is a func that checks the error (right now it will panic if error but later it could check errors more thoughtfully )
func CompareInt ¶
CompareInt compairs int32 arrays if x!=y then false else true
func CompareInt32 ¶
CompareInt32 compairs int32 arrays if x!=y then false else true
func CopyDimsInt32 ¶
CopyDimsInt32 returns a copy of the dims.
func Dims ¶
Dims is a QOL func that can be used to organize code by renmaing it and using it in funcs all it does is just return an array of the arguements passed in it. example: slide:=utils.Dims Then when building a cnn layer you can do slide(2,2)
func FindFittingStride ¶
FindFittingStride only works if destdims[i]=n*srcdims[i] where n is an int This will give strides to srcdims so that it could kind of fit into destdims. Usually it is spaced with zeros
func FindMaxVolExtimate ¶
FindMaxVolExtimate will return an extimated maxvol for any kind of reshape of a volume, and it will round it up to the batch size
func FindMaxVolThroughMaxBatch ¶
FindMaxVolThroughMaxBatch through the max number of batches
func FindStridesInt ¶
FindStridesInt returns the strides of the dims given for an array. example if for an array of NCHW it will return [C*H*W,H*W,W,1] those can be used for traversing a 4d array
func FindStridesInt32 ¶
FindStridesInt32 returns the strides of the dims given for an array. example if for an array of NCHW it will return [C*H*W,H*W,W,1] those can be used for traversing a 4d array
func FindVolumeInt ¶
FindVolumeInt returns the total volume in int
func FindVolumeInt32 ¶
FindVolumeInt32 returns the total volume in int32 if stride is nil it will find volume based purly on the dims
func Gaussian2dKernel ¶
Gaussian2dKernel will return a
func MultiplyAll ¶
MultiplyAll adds value to all the elements in data
func NormalGaussianVector ¶
NormalGaussianVector randomlygenerated vector of gaussian values that are then normalized
func NormalSortedGaussianVector ¶
NormalSortedGaussianVector sorts randomlygenerated vector of gaussian values that are then normalized
func NumbertoString ¶
NumbertoString will add zeros to the left of numbers. So it will file in order
func RandWeightSet ¶
RandWeightSet sets a randomweight based on min max values
func RandomFloat32 ¶
RandomFloat32 returns a random float32
func RandomFloat64 ¶
RandomFloat64 returns a random float64
func RandomGaussianKernelsInChannels ¶
RandomGaussianKernelsInChannels makes 2d GaussianKernels that are in the channels
func RandomSigmaGaussian2dKernel ¶
RandomSigmaGaussian2dKernel returns a randomly generated Gaussian 2d Kernal
func SetAllEx ¶
func SetAllEx(sliceofvaltype interface{}, val interface{})
SetAllEx sets all the elements in sliceofvaltype to val. sliceofvaltype needs to be a slice of val. It will panic if not. Also unsupported slices will not work. It will take all 1d slices of go types. It will also take slices of half.Float16. And slices of cutil.CScalar.
func ToFLoat64Slice ¶
func ToFLoat64Slice(input interface{}) []float64
ToFLoat64Slice takes a go slice and converts it to a []float64.
func ToFloat32Slice ¶
func ToFloat32Slice(input interface{}) []float32
ToFloat32Slice takes a go typed slice and converts it to a []float32 slice
func ToInt32Slice ¶
func ToInt32Slice(input interface{}) []int32
ToInt32Slice takes a go slice and convets it to a []int32. No overflow checking
func ToInt8Slice ¶
func ToInt8Slice(input interface{}) []int8
ToInt8Slice takes a go slice and convets it to a []int8. No overflow checking
func ToUint8Slice ¶
func ToUint8Slice(input interface{}) []uint8
ToUint8Slice takes a go slice and convets it to a []uint8. No overflow checking
Types ¶
This section is empty.