Documentation ¶
Index ¶
- Variables
- func ArgMax(s []float32) (int, float32, error)
- func CloseFile(file io.Closer) error
- func GetPathType(path string) string
- func Mean(vector []float32) float32
- func Norm(v []float32, p int) float64
- func Normalize(embedding []float32, p int) []float32
- func PathJoinSafe(elem ...string) string
- func ReadFileBytes(filename string) ([]byte, error)
- func Sigmoid(s []float32) []float32
- func SoftMax(vector []float32) []float32
- func SumSlice(s []float64) float64
Constants ¶
This section is empty.
Variables ¶
View Source
var FileSystem = afs.New()
Functions ¶
func GetPathType ¶
func Normalize ¶ added in v0.1.1
Normalize single vector according to: https://pytorch.org/docs/stable/generated/torch.nn.functional.normalize.html
func PathJoinSafe ¶
PathJoinSafe wrapper around filepath.Join to ensure that paths are correctly constructed if the path is a normal OS path, just use filepath.Join if the path is S3, trim any trailing slashes and construct it manually from the components so that double slashes (e.g. s3://) are preserved.
func ReadFileBytes ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.