Expand description
§concision-neural
This crate focuses on implementing various neural network components, including models, layers, and training mechanisms.
§Overview
Neural networks are a fundamental part of machine learning, and this crate provides a comprehensive set of tools to build, configure, and train neural network models. Listed below are several key components of the crate:
- Model: A trait for defining a neural network model.
- ModelParamsBase: A dedicated object capable of storing the parameters for both shallow and deep neural networks.
- StandardModelConfig: A standard configuration for the models
§Traits
This crate extends the Forward and Backward traits
from the core crate to provide additional functionality for neural networks.
Modules§
- config
- error
- this module defines the NeuralErrortype, used to define the various errors encountered by the different components of a neural network. Additionally, theNeuralResultalias is defined for convenience, allowing for a more ergonomic way to handle results that may fail.
- layers
- This module implments various layers for a neural network
- model
- This module provides the scaffolding for creating models and layers in a neural network.
Structs§
- Dropout
- The Dropout layer is randomly zeroizes inputs with a given probability (p). This regularization technique is often used to prevent overfitting.
- HyperparametersIter 
- An iterator over the variants of Hyperparameters
- KeyValue
- The KeyValuetype is used to generically represent a simple key-value pair within a store.
- LayerBase 
- ModelFeatures 
- The ModelFeaturesprovides a common way of defining the layout of a model. This is used to define the number of input features, the number of hidden layers, the number of hidden features, and the number of output features.
- ModelParams Base 
- The ModelParamsBaseobject is a generic ocntainer for storing the parameters of a neural network, regardless of the layout (e.g. shallow or deep). This is made possible through the introduction of a generic hidden layer type,H, that allows us to define aliases and additional traits for contraining the hidden layer type. That being said, we don’t reccoment using this type directly, but rather use the provided type aliases such asDeepModelParamsorShallowModelParamsor their owned variants. These provide a much more straighforward interface for typing the parameters of a neural network. We aren’t too worried about the transumtation between the two since users desiring this ability should simply stick with a deep representation, initializing only a single layer within the respective container.
- StandardModel Config 
- Trainer
Enums§
- HyperParams 
- Hyperparameters
- Auto-generated discriminant enum variants
- NeuralError 
- The NeuralErrortype is used to define the various errors encountered by the different components of a neural network. It is designed to be comprehensive, covering a wide range of potential issues that may arise during the operation of neural network components, such as invalid configurations, training failures, and other runtime errors. This error type is intended to provide a clear and consistent way to handle errors across the neural network components, making it easier to debug and resolve issues that may occur during the development and execution of neural network models.
- TrainingError 
Traits§
- DeepNeural Network 
- The DeepNeuralNetworktrait is a specialization of theModeltrait that provides additional functionality for deep neural networks. This trait is
- DeepNeural Store 
- The DeepNeuralStoretrait for deep neural networks
- Layer
- A layer within a neural-network containing a set of parameters and an activation function. Here, this manifests as a wrapper around the parameters of the layer with a generic activation function and corresponding traits to denote desired behaviors.
- Model
- The base interface for all models; each model provides access to a configuration object
defined as the associated type Config. The configuration object is used to provide hyperparameters and other control related parameters. In addition, the model’s layout is defined by thefeaturesmethod which aptly returns a copy of its [ModelFeatures] object.
- ModelExt 
- ModelLayout 
- ModelTrainer 
- NetworkConfig 
- The NetworkConfigtrait extends theRawConfigtrait to provide a more robust interface for neural network configurations.
- Predict
- Predict isn’t designed to be implemented directly, rather, as a blanket impl for any
entity that implements the Forwardtrait. This is primarily used to define the base functionality of theModeltrait.
- PredictWith Confidence 
- This trait extends the Predicttrait to include a confidence score for the prediction. The confidence score is calculated as the inverse of the variance of the output.
- RawConfig
- The RawConfigtrait defines a basic interface for all configurations used within the framework for neural networks, their layers, and more.
- RawHidden
- The RawHiddentrait for compatible representations of hidden layers
- ShallowNeural Store 
- The ShallowNeuralStoretrait for shallow neural networks
- Train
- This trait defines the training process for the network
- TrainingConfiguration 
Type Aliases§
- DeepModel Params 
- a type alias for an owned representation of the DeepParamsBasegeneric of typeAand the dimensionD.
- DeepParams Base 
- a type alias for a deep representation of the ModelParamsBaseusing a vector of parameters as the hidden layers.
- NeuralResult 
- a type alias for a Result configured to use the NeuralErrorimplementation as its error type.
- ShallowModel Params 
- a type alias for an owned representation of the DeepParamsBasegeneric of typeAand the dimensionD.
- ShallowParams Base 
- a type alias for a shallow representation of the ModelParamsBaseusing a singleParamsBaseinstance as the hidden layer.