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 OpenFile(filename string) (io.ReadCloser, error)
- func PathJoinSafe(elem ...string) string
- func ReadFileBytes(filename string) ([]byte, error)
- func ReadLine(r *bufio.Reader) ([]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 ¶
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 ¶
func ReadLine ¶ added in v0.3.0
ReadLine returns a single line (without the ending \n) from the input buffered reader. An error is returned if there is an error with the buffered reader. This function is needed to avoid the 65K char line limit
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.