Resource retrieval
Get the uninitialized net (there are no pre-trained nets in this model):
NetModel parameters
This model consists of a family of individual nets, each identified by a specific parameter combination. Inspect the available parameters:
Pick a non-default model by specifying the parameters:
Check the default parameter combination:
Basic usage
Classification on numerical data: In this example, we use an eight-layer self-normalizing network to perform classification on the UCI Letter dataset. First, obtain the training and test data:
View two random training examples:
Self-normalizing nets assume that the input data has a mean of 0 and variance of 1. Standardize the test and training data:
Get the training net:
Specify a decoder for the net:
Train the net for 150 rounds, leaving 5% of the data for a validation set:
Obtain the accuracy of the trained net on the standardized test set:
Compare the accuracy against all the methods in Classify:
Obtain a random sample of standardized test data:
Test the trained net on a sample of standardized test data:
Improving accuracy of the classifier net
Using the same example for data, first we obtain the dataset:
Standardize the test and training data in similar fashion:
Get the training net:
Specify a decoder for the net:
To improve the final accuracy, it is possible to average multiple trained networks obtained from different training runs. The following function runs multiple trainings and creates an ensemble network, which averages the outputs of the trained nets:
Specify the number of nets in the ensemble and create the ensemble network:
Obtain the accuracy of the ensemble network:
Compare it with the accuracy of the individual nets:
Classification on nominal data
In this example, we use an eight-layer self-normalizing network to perform classification on the Mushroom Classification dataset. First, obtain the training and test data:
View two random training examples:
To standardize this data, we first need to convert all the nominal input classes into indicator vectors:
Then standardize the numeric vectors:
Create the standardized test and training dataset:
Get the training net:
Specify a decoder for the net:
Train the net for 150 rounds, leaving 5% of the data for a validation set:
Compare the accuracy against all the methods in Classify:
Obtain a sample of standardized test data and view the actual class labels:
Test the trained net on a sample of standardized test data:
Regression on numerical data
In this example, we use an eight-layer self-normalizing network to predict the median value of properties in a neighborhood of Boston, given some features of the neighborhood. First, obtain the training and test data:
View two random training examples:
Self-normalizing nets assume that the input data has a mean of 0 and variance of 1. Standardize the test and training data:
Get the training net:
Train the net for 250 rounds leaving 7% of the data for a validation set and return both the trained net and the lowest validation loss:
Compute the test-set standard deviation:
Compare the standard deviation against all the methods in Predict:
Obtain a sample of standardized test data and view the actual class labels:
Test the trained net on a sample of standardized test data:
Regression on nominal data
Create a dataset of the average monthly temperature (in degrees Celsius) as a function of the city, the year and the month:
View two random examples:
Split the data into training (80%) and test (20%) sets:
To standardize this data, we need to convert all the nominal classes to a indicator vectors:
Then standardize the numeric vector:
Create the standardized test and training dataset:
Get the training net:
Train the net for 1000 rounds leaving 7% of the data for a validation set and return both the trained net and the lowest validation loss:
Compute the test-set standard deviation:
Compare the standard deviation against all the methods in Predict:
Obtain a sample of standardized test data and view the actual class labels:
Test the trained net on a sample of standardized test data:
Net information
Obtain the layer type counts:
Display the summary graphic:
Export to MXNet
Export the net into a format that can be opened in MXNet. Input and output size must be specified before exporting:
Represent the MXNet net as a graph: