MCPcopy Create free account
hub / github.com/evilsocket/sum / DotRange

Method DotRange

wrapper/record.go:80–85  ·  view source on GitHub ↗

DotRange performs the dot product between a vector and another using a range of elements.

(b *Record, start uint, end uint)

Source from the content-addressed store, hash-verified

78
79// DotRange performs the dot product between a vector and another using a range of elements.
80func (w *Record) DotRange(b *Record, start uint, end uint) float64 {
81 elems := int(end - start)
82 aRange := backend.Wrap(elems, w.record.Data[start:end])
83 bRange := backend.Wrap(elems, b.record.Data[start:end])
84 return backend.Dot(aRange, bRange)
85}
86
87// DotSub performs the dot product between a vector and another using up until the specificed number of elements.
88func (w *Record) DotSub(b *Record, elems uint) float64 {

Callers 2

DotSubMethod · 0.95
CosineRangeMethod · 0.95

Calls 2

WrapMethod · 0.65
DotMethod · 0.65

Tested by

no test coverage detected