vector

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Copyright (C) 2019-2022 vdaas.org vald team <vald@vdaas.org>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnknownDistribution = errors.New("Unknown distribution generator type")

ErrUnknownDistritbution represents an error which the distribution is unknown.

Functions

func GaussianDistributedFloat32VectorGenerator

func GaussianDistributedFloat32VectorGenerator(n, dim int) [][]float32

GaussianDistributedFloat32VectorGenerator returns n float32 vectors with dim dimension and their values under Gaussian distribution

func GaussianDistributedUint8VectorGenerator

func GaussianDistributedUint8VectorGenerator(n, dim int) [][]uint8

GaussianDistributedUint8VectorGenerator returns n uint8 vectors with dim dimension and their values under Gaussian distribution

func UniformDistributedFloat32VectorGenerator

func UniformDistributedFloat32VectorGenerator(n, dim int) [][]float32

UniformDistributedFloat32VectorGenerator returns n float32 vectors with dim dimension and their values under Uniform distribution

func UniformDistributedUint8VectorGenerator

func UniformDistributedUint8VectorGenerator(n, dim int) [][]uint8

UniformDistributedUint8VectorGenerator returns n uint8 vectors with dim dimension and their values under Uniform distribution

Types

type Distribution

type Distribution int
const (
	Gaussian Distribution = iota
	Uniform
)

type Float32VectorGeneratorFunc

type Float32VectorGeneratorFunc func(int, int) [][]float32

func Float32VectorGenerator

func Float32VectorGenerator(d Distribution) (Float32VectorGeneratorFunc, error)

Float32VectorGenerator returns float32 vector generator function which has selected distribution

type Uint8VectorGeneratorFunc

type Uint8VectorGeneratorFunc func(int, int) [][]uint8

func Uint8VectorGenerator

func Uint8VectorGenerator(d Distribution) (Uint8VectorGeneratorFunc, error)

Uint8VectorGenerator returns uint8 vector generator function which has selected distribution

Jump to

Keyboard shortcuts

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