arc

package
v0.0.0-...-3003f44 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// Symbols
	Symbols = 32
	// Size is the link size
	Size = 16
	// Input is the network input size
	Input = 2 * Size
	// S is the scaling factor for the softmax
	S = 1.0 - 1e-300
	// Scale is the scale of the search
	Scale = 33 //48 96
	// SymbolsCount is the number of unique symbols in a puzzle
	SymbolsCount = 32
	// Samples is the number of samples
	Samples = Scale * (Scale - 1) / 2
)

Variables

This section is empty.

Functions

func Arc

func Arc()

Arc is the arc model

func Dot

func Dot(x, y []float32) (z float32)

Dot computes the dot product

func PageRank

func PageRank(x, y Matrix, graph []float64)

PageRank computes the page rank of Q, K

Types

type Example

type Example struct {
	Input  [][]byte `json:"input"`
	Output [][]byte `json:"output"`
}

Example is a learning example

type Matrix

type Matrix struct {
	Cols int
	Rows int
	Data []float32
}

Matrix is a float32 matrix

func NewMatrix

func NewMatrix(cols, rows int, data ...float32) Matrix

NewMatrix creates a new float64 matrix

func NewZeroMatrix

func NewZeroMatrix(cols, rows int) Matrix

NewZeroMatrix creates a new float64 matrix of zeros

func (Matrix) MulT

func (m Matrix) MulT(n Matrix) Matrix

MulT multiplies two matrices and computes the transpose

func (Matrix) Sigmoid

func (m Matrix) Sigmoid() Matrix

Sigmoid computes the sigmoid of a matrix

func (Matrix) TanH

func (m Matrix) TanH() Matrix

TanH computes the tanh of a matrix

type Puzzle

type Puzzle []byte

Puzzle is a puzzle

func (Puzzle) Illuminatus

func (puzzle Puzzle) Illuminatus(seed int64) int

Illuminatus

func (Puzzle) Q

func (p Puzzle) Q() []byte

Q is the query portion of a puzzle

func (Puzzle) Search

func (puzzle Puzzle) Search(seed int64) []Sample

Search searches for a symbol

type Random

type Random struct {
	Mean   float32
	Stddev float32
}

Random is a gaussian distribution

type RandomMatrix

type RandomMatrix struct {
	Cols int
	Rows int
	Rand []Random
	Seed int64
}

RandomMatrix is a random matrix

func NewRandomMatrix

func NewRandomMatrix(cols, rows int, seed int64, r ...Random) RandomMatrix

NewRandomMatrix creates a new gaussian random matrix

func (RandomMatrix) Sample

func (g RandomMatrix) Sample() Matrix

Sample generates a matrix from a gaussian distribution

type Sample

type Sample struct {
	A        RandomMatrix
	B        RandomMatrix
	Graph    []float64
	Ranks    []float64
	Variance float64
}

Sample is a sample

type Set

type Set struct {
	Test  []Example `json:"test"`
	Train []Example `json:"train"`
}

Set is a set of examples

func Load

func Load() []Set

Load loads the data

Jump to

Keyboard shortcuts

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