t_wの輪郭
フォローする
このサイトについて
Amazonで検索:fann
8/13/2023, 11:50:00 PM
package main

import (
	"fmt"

	"github.com/arian/fann/fann"
	"github.com/arian/fann/vector"
)

type store struct {
	invertedIndex map[string]int
	words         []string
	vectors       []vector.Vector
}

func main() {
	index := fann.NewANNIndex(
		10,
		8,
		[]vector.Vector{{1, 2}, {4, 1}, {-1, -2}},
	)

	found := index.SearchApproximate(vector.Vector{4, 2}, 10)
	fmt.Println(found)
}

出力
[1 0 2]

Amazonで検索:fannの実行例