mlp

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithBatchSize

func WithBatchSize(batchSize int) func(*neuralModel)

func WithDropout

func WithDropout(dropout float64) func(*neuralModel)

func WithL2Regularization

func WithL2Regularization(lambd float64) func(*neuralModel)

func WithLogInterval

func WithLogInterval(interval int) func(*fitConfig)

func WithSeed added in v1.6.1

func WithSeed(seed uint64) func(*neuralModel)

func WithShuffle added in v1.6.1

func WithShuffle(shuffle bool) func(*fitConfig)

func WithVerbose

func WithVerbose(verbose bool) func(*fitConfig)

Types

type NeuralConfig

type NeuralConfig struct {
	NNStructure []int
	Activation  nncore.ActivationType
	Mode        nncore.ModeType
}

type NeuralModel

type NeuralModel interface {
	// performs model training using the xTrain and yTrain matrices.
	// both matrices have shape (nFeatures, nSamples), where each row
	// corresponds to a feature and each column corresponds to a training sample.
	Fit(xTrain *mat.Dense, yTrain *mat.Dense, options ...func(*fitConfig)) []float64
	Predict(x *mat.Dense) *mat.Dense
	Evaluate(x *mat.Dense, y *mat.Dense) float64
	Save(path string)
	Summary()
}

func Load

func Load(path string) NeuralModel

type NeuralNetwork

type NeuralNetwork interface {
	NewTrainer(config TrainerConfig, options ...func(*neuralModel)) NeuralModel
}

func NewNeuralNetwork

func NewNeuralNetwork(config NeuralConfig) NeuralNetwork

type TrainerConfig

type TrainerConfig struct {
	Optimizer    nncore.OptimizerType
	LearningRate float64
	Epochs       int
}

Jump to

Keyboard shortcuts

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