config

package
v0.0.0-...-ebc0b1d Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Network holds neural network configuration
	Network *NetConfig
	// Training holds neural network training configuration
	Training *TrainConfig
}

Config allows to specify neural network architecture and training configuration

func New

func New(manPath string) (*Config, error)

New returns neural network config struct based on the supplied manifest file. It accepts path to a config manifest file as a parameter. It returns error if the supplied manifest file can't be open or if it can not be parsed into a valid configration object.

func ParseManifest

func ParseManifest(m *Manifest) (*Config, error)

ParseManifest parses the manifest supplied as a parameter into Config or fails with error

type LayerConfig

type LayerConfig struct {
	// Kind is neural network layer kind: input, output, hidden
	Kind string
	// Size represents a number of neurons in the network layer
	Size int
	// NeurFn holds neuron configuration
	NeurFn *NeuronConfig
}

LayerConfig allows to specify neural network layer configuration

type Manifest

type Manifest struct {
	// Kind holds neural network Kind: feedfwd
	Kind string `yaml:"kind"`
	// Task is neural network task: class, [cluster, predict]
	Task string `yaml:"task"`
	// Network provides neural network layer config and topology
	Network struct {
		// Input layer configuration
		Input struct {
			// Size represents number of input neurons
			Size int `yaml:"size"`
		} `yaml:"input"`
		// Hidden layers configuration
		Hidden struct {
			// Size contains sizes of all hidden layers
			Size []int `yaml:"size"`
			// Activation is neuron activation function
			Activation string `yaml:"activation"`
		} `yaml:"hidden,omitempty"`
		// Output layer configuration
		Output struct {
			// Size represents number of input neurons
			Size int `yaml:"size"`
			// Activation is neuron activation function
			Activation string `yaml:"activation"`
		} `yaml:"output"`
	} `yaml:"network"`
	// Training holds neural network training configuration
	Training struct {
		// Kind holds kind of neural network training
		Kind string `yaml:"kind"`
		// Cost allows to specify cost function: xentropy, loglike
		Cost string `yaml:"cost"`
		// Params contains parameters of neural training
		Params struct {
			// Lambda is regualirzation parameter
			Lambda float64 `yaml:"lambda"`
		} `yaml:"params"`
		// Optimize contains configuration for training optimization
		Optimize struct {
			// Method represents type of optimization
			Method string `yaml:"method"`
			// Iterations is a number of major optimization iterations
			Iterations int `yaml:"iterations,omitempty"`
		} `yaml:"optimize,omitempty"`
	} `yaml:"training"`
}

Manifest is a data structure used to decode neural network configuration manifest

type NetArch

type NetArch struct {
	// Input layer configuration
	Input *LayerConfig
	// Hidden layers configuration. It is a slice as there can be multiple hidden layers
	Hidden []*LayerConfig
	// Output layer configuration
	Output *LayerConfig
}

NetArch specifies neural network architecture

type NetConfig

type NetConfig struct {
	// Kind is Neural Network type
	Kind string
	// Arch specifies network architecture
	Arch *NetArch
}

NetConfig allows to specify Neural Network parameters

type NeuronConfig

type NeuronConfig struct {
	// Activation is a neuron activation function
	Activation string
}

NeuronConfig allows to specify neuron configuration

type OptimConfig

type OptimConfig struct {
	// Method is an advanced optimization method
	// Currently only bfgs algorithm is supported
	Method string
	// Iterations specifies the number of optimization iterations
	Iterations int
}

OptimConfig allows to specify advanced optimization configuration

type TrainConfig

type TrainConfig struct {
	// Kind is a neural network training type: backprop
	Kind string
	// Cost is a neural network cost function
	Cost string
	// Lambda is regularizer parameter
	Lambda float64
	// Optimize holds training optimization parameters
	Optimize *OptimConfig
}

TrainConfig allows to specify neural network training configuration

Jump to

Keyboard shortcuts

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