galaktaglare

package module
v2.0.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backward

func Backward(result *Variable)

func ReLU

func ReLU(x float64) float64

func Sigmoid

func Sigmoid(x float64) float64

Types

type ActivationFunc

type ActivationFunc func(float64) float64

type BatchNormalization

type BatchNormalization struct {
	Gamma    float64
	Beta     float64
	Mean     []float64
	Variance []float64
	Epsilon  float64
	Input    []float64
	Output   []float64
}

func NewBatchNormalization

func NewBatchNormalization(gamma, beta, epsilon float64) *BatchNormalization

func (*BatchNormalization) Forward

func (bn *BatchNormalization) Forward(input []float64) []float64

type DataAnalysis

type DataAnalysis struct{}

func (*DataAnalysis) Mean

func (da *DataAnalysis) Mean(data []float64) float64

func (*DataAnalysis) Median

func (da *DataAnalysis) Median(data []float64) float64

func (*DataAnalysis) Mode

func (da *DataAnalysis) Mode(data []float64) []float64

type DecisionTree

type DecisionTree struct {
	Root *TreeNode
}

func (*DecisionTree) Predict

func (dt *DecisionTree) Predict(features []float64) string

func (*DecisionTree) Train

func (dt *DecisionTree) Train(data []Example, maxDepth, minSamplesSplit int)

type DenseLayer

type DenseLayer struct {
	InputSize            int
	OutputSize           int
	Weights              [][]float64
	Biases               []float64
	Activation           ActivationFunc
	Inputs               []float64
	WeightDecayL1        float64
	WeightDecayL2        float64
	DropoutRate          float64
	DropoutMask          []float64
	LearningRateSchedule LearningRateSchedule
	BatchNorm            *BatchNormalization
}

func NewDenseLayer

func NewDenseLayer(inputSize, outputSize int, activation ActivationFunc, weightDecayL1, weightDecayL2, dropoutRate float64, lrSchedule LearningRateSchedule) *DenseLayer

func (*DenseLayer) Backpropagate

func (l *DenseLayer) Backpropagate(output, target []float64, learningRate float64) []float64

func (*DenseLayer) Forward

func (l *DenseLayer) Forward(input []float64) []float64

func (*DenseLayer) GetAdjustedLearningRate

func (l *DenseLayer) GetAdjustedLearningRate(epoch int) float64

type Example

type Example struct {
	Features []float64
	Label    string
}

type GalaktaGlare

type GalaktaGlare struct {
	// contains filtered or unexported fields
}

func New

func New() *GalaktaGlare

func (*GalaktaGlare) AnomalyDetector

func (gg *GalaktaGlare) AnomalyDetector(data []float64, threshold float64) []int

func (*GalaktaGlare) ExtractEntities

func (gg *GalaktaGlare) ExtractEntities(text string, customStopwords map[string]bool) []string

func (*GalaktaGlare) ImageDB

func (gg *GalaktaGlare) ImageDB(folderPath string) error

func (*GalaktaGlare) ImageScan

func (gg *GalaktaGlare) ImageScan(imagePath string) (float64, error)

func (*GalaktaGlare) Numseq added in v2.0.4

func (gg *GalaktaGlare) Numseq(s string) float64

func (*GalaktaGlare) StrNQ added in v2.0.4

func (gg *GalaktaGlare) StrNQ(n float64) string

func (*GalaktaGlare) TextClassifier

func (gg *GalaktaGlare) TextClassifier(text, config string) (string, error)

func (*GalaktaGlare) TextToSpeech added in v2.0.2

func (gg *GalaktaGlare) TextToSpeech(text, lang string) error

type LearningRateSchedule

type LearningRateSchedule struct {
	InitialRate float64
	Decay       float64
}

type NeuralNetwork

type NeuralNetwork struct {
	Layers []*DenseLayer
}

func LoadModel

func LoadModel(filename string) (*NeuralNetwork, error)

func NewNeuralNetwork

func NewNeuralNetwork(layers ...*DenseLayer) *NeuralNetwork

func (*NeuralNetwork) Backpropagate

func (nn *NeuralNetwork) Backpropagate(output, target []float64, learningRate float64)

func (*NeuralNetwork) MultiplyMatrixVector

func (nn *NeuralNetwork) MultiplyMatrixVector(matrix [][]float64, vector []float64) []float64

func (*NeuralNetwork) MultiplyVectors

func (nn *NeuralNetwork) MultiplyVectors(v1 []float64, v2 []float64) []float64

func (*NeuralNetwork) Predict

func (nn *NeuralNetwork) Predict(input []float64) []float64

func (*NeuralNetwork) SaveModel

func (nn *NeuralNetwork) SaveModel(filename string) error

func (*NeuralNetwork) Train

func (nn *NeuralNetwork) Train(inputs, targets [][]float64, initialLearningRate float64, epochs int)

type Tensor

type Tensor struct {
	// contains filtered or unexported fields
}

func NewTensor

func NewTensor(shape []int) *Tensor

func (*Tensor) Get

func (t *Tensor) Get(indices ...int) float64

func (*Tensor) Set

func (t *Tensor) Set(value float64, indices ...int)

type TrainingMonitor

type TrainingMonitor struct {
	Epochs        int
	DisplayPeriod int
}

func NewTrainingMonitor

func NewTrainingMonitor(epochs, displayPeriod int) *TrainingMonitor

func (*TrainingMonitor) MonitorTraining

func (tm *TrainingMonitor) MonitorTraining(nn *NeuralNetwork, inputs, targets [][]float64, initialLearningRate float64)

type TreeNode

type TreeNode struct {
	SplitFeature   int
	SplitValue     float64
	PredictedClass string
	Left           *TreeNode
	Right          *TreeNode
}

type Variable

type Variable struct {
	Value     float64
	Gradient  float64
	Children  []*Variable
	Operation string
}

func Add

func Add(a, b *Variable) *Variable

func Cos

func Cos(a *Variable) *Variable

func Mul

func Mul(a, b *Variable) *Variable

func NewVariable

func NewVariable(value float64, operation string) *Variable

func Sin

func Sin(a *Variable) *Variable

Jump to

Keyboard shortcuts

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