cmplxNN

package module
v0.0.0-...-a70fcc5 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 2 Imported by: 0

README

cmplxNN

golang implementation of nuetral net using complex numbers

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Normalize = func(c complex128) complex128 {
	abs := cmplx.Abs(c)
	return c * complex(1/abs, 0) * complex(-math.Expm1(-abs), 0)
}

Normalize is a function for normalizing the output values of Nueral Network Layers. is a variable that can be replaced with another function to allow to alternate Normalization functions

Functions

This section is empty.

Types

type Layer

type Layer struct {
	// Weights is a matrix of complex128 weights, w[row][column] indexing.
	// the number of columns is the expected dimension of the input array
	// the number of rows is the dimension of the output array
	Weights [][]complex128
	// Bias is added to the output after adjusting based on the weight and before normalizing the values.
	// the length of the bias should match the number of rows in Weights
	Bias []complex128
}

Layer is a matrix representation of a layer of a nueral net.

func (*Layer) Generate

func (l *Layer) Generate(in []complex128) (out []complex128)

type Model

type Model interface {
	Generate([]complex128) []complex128
}

type NueralNet

type NueralNet struct {
	Layers []Layer
}

func (*NueralNet) Generate

func (nn *NueralNet) Generate(in []complex128) (out []complex128)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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