turing

package
v0.0.0-...-bbe66a5 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Size is the link size
	Size = 16
	// Input is the network input size
	Input = Size + 2*Size
	// Scale is the scale of the search
	Scale = 33 //48 96
	// Samples is the number of samplee
	Samples = Scale * (Scale - 1) / 2
	// TapeSize is the size of the tape
	TapeSize = 64
	// TapeMask is the mask for the MSB of the tape
	TapeMask = 1 << (TapeSize - 1)
)

Variables

This section is empty.

Functions

func Dot

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

Dot computes the dot product

func PageRank

func PageRank(x, y Matrix) []float64

PageRank computes the page rank of Q, K

func Step

func Step(rng *rand.Rand, tape []byte) int

Step steps the turing machine

func Turing

func Turing(target int)

Turing is turing mode

Types

type Cell

type Cell struct {
	Age  float64
	Loss float64
	Head int
	Tape []byte
}

Cell is a cell

func NewCell

func NewCell(rng *rand.Rand, size int) Cell

NewCell creates a new cell

func (Cell) Bits

func (c Cell) Bits() uint64

Bits returns the bits

func (Cell) Copy

func (c Cell) Copy() Cell

func (*Cell) Step

func (c *Cell) Step(rng *rand.Rand)

Step steps the cell

type Matrix

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

Matrix is a float64 matrix

func NewMatrix

func NewMatrix(cols, rows int, data ...complex128) 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

type RandomMatrix

type RandomMatrix struct {
	Cols int
	Rows int
	Seed int64
}

RandomMatrix is a random matrix

func NewRandomMatrix

func NewRandomMatrix(cols, rows int, seed int64) 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
	Order    [2]RandomMatrix
	Symbol   [2]RandomMatrix
	Ranks    []float64
	Variance float64
}

Sample is a sample

Jump to

Keyboard shortcuts

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