Documentation ¶
Overview ¶
Copyright (C) 2019-2023 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 ¶
- Variables
- func ConvertVectorsUint8ToFloat32(vectors [][]uint8) (ret [][]float32)
- func GaussianDistributedFloat32VectorGenerator(n, dim int) [][]float32
- func GaussianDistributedUint8VectorGenerator(n, dim int) [][]uint8
- func GenF32Vec(dist Distribution, num int, dim int) ([][]float32, error)
- func GenSameValueVec(size int, val float32) []float32
- func GenUint8Vec(dist Distribution, num int, dim int) ([][]float32, error)
- func NegativeUniformDistributedFloat32VectorGenerator(n, dim int) (vecs [][]float32)
- func UniformDistributedFloat32VectorGenerator(n, dim int) [][]float32
- func UniformDistributedUint8VectorGenerator(n, dim int) [][]uint8
- type Distribution
- type Float32VectorGeneratorFunc
- type Uint8VectorGeneratorFunc
Constants ¶
This section is empty.
Variables ¶
var ErrUnknownDistribution = errors.New("Unknown distribution generator type")
ErrUnknownDistribution represents an error which the distribution is unknown.
Functions ¶
func ConvertVectorsUint8ToFloat32 ¶ added in v1.5.4
ConvertVectorsUint8ToFloat32 converts uint8 vectors and return float32 vectors
func GaussianDistributedFloat32VectorGenerator ¶
GaussianDistributedFloat32VectorGenerator returns n float32 vectors with dim dimension and their values under Gaussian distribution
func GaussianDistributedUint8VectorGenerator ¶
GaussianDistributedUint8VectorGenerator returns n uint8 vectors with dim dimension and their values under Gaussian distribution
func GenF32Vec ¶ added in v1.5.4
func GenF32Vec(dist Distribution, num int, dim int) ([][]float32, error)
GenF32Vec returns multiple float32 vectors.
func GenSameValueVec ¶ added in v1.5.4
GenSameValueVec returns a float32 vector filled with value.
func GenUint8Vec ¶ added in v1.5.4
func GenUint8Vec(dist Distribution, num int, dim int) ([][]float32, error)
GenUint8Vec returns multiple uint8 vectors.
func NegativeUniformDistributedFloat32VectorGenerator ¶ added in v1.7.0
NegativeUniformDistributedFloat32VectorGenerator returns n float32 vectors with dim dimension and their values under Uniform distribution
func UniformDistributedFloat32VectorGenerator ¶
UniformDistributedFloat32VectorGenerator returns n float32 vectors with dim dimension and their values under Uniform distribution
func UniformDistributedUint8VectorGenerator ¶
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 NegativeUniform )
type Float32VectorGeneratorFunc ¶
func Float32VectorGenerator ¶
func Float32VectorGenerator(d Distribution) (Float32VectorGeneratorFunc, error)
Float32VectorGenerator returns float32 vector generator function which has selected distribution
type Uint8VectorGeneratorFunc ¶
func Uint8VectorGenerator ¶
func Uint8VectorGenerator(d Distribution) (Uint8VectorGeneratorFunc, error)
Uint8VectorGenerator returns uint8 vector generator function which has selected distribution