Beispiel #1
0
// Hash returns a randomly-distributed hash of the sample.
func (s Sample) Hash() []byte {
	allVecs := make([]linalg.Vector, len(s.Inputs)+len(s.Outputs))
	copy(allVecs, s.Inputs)
	copy(allVecs[len(s.Inputs):], s.Outputs)
	return sgd.HashVectors(allVecs...)
}
Beispiel #2
0
// Hash generates a randomly-distributed hash based on
// the vector data.
func (v VectorSample) Hash() []byte {
	return sgd.HashVectors(v.Input, v.Output)
}