txt

package
v0.0.0-...-8099d2f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2024 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Symbols
	Symbols = ('z' - 'a' + 1) + ('Z' - 'A' + 1) + 3
	// Size is the link size
	Size = 8
	// Input is the network input size
	Input = Size + 2*Size
	// S is the scaling factor for the softmax
	S = 1.0 - 1e-300
	// Scale is the scale of the search
	Scale = 33 //96
	// SetSize is the size of a symbol set
	SetSize = 4
	// Samples is the number of samplee
	Samples = Scale * (Scale - 1) / 2
)

Variables

View Source
var (
	// To converts to a code
	To = make(map[byte]int, Symbols)
	// From converts from a code
	From = make(map[int]byte, Symbols)
)

Functions

func PageRank

func PageRank(Q, K matrix.Matrix) []float32

PageRank computes the page rank of Q, K

func Text

func Text(full bool, s int, seed uint32) int

Text mode

func Text2

func Text2(full bool, s int, seed uint32) int

Text mode

Types

type Model

Model model is the random matrix model

type Problem

type Problem struct {
	Opt    matrix.Matrix
	Input  []byte
	Output []byte
	Count  int
}

Problem is an optimization problem

func (Problem) Size

func (p Problem) Size() int

Size is the size of the input

type Sample

Sample is a sample

func Search(sets Sets, s int, seed uint32) []Sample

Search searches for a symbol

type Set

type Set struct {
	Text []byte
}

Set is a set of examples

type Sets

type Sets []Set

Sets is many sets

func Load

func Load() Sets

Load load text data

func (Sets) GetSingleTrainingData

func (sets Sets) GetSingleTrainingData(s int) Problem

GetSingleTrainingData gets the training data

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL