Resource retrieval
Retrieve the pre-trained net:
Basic usage
Apply the trained net to a set of inputs:
Give class probabilities for a single input:
Feature extraction
Create a subset of the MNIST dataset:
Remove the last linear layer of the net, which will be used as a feature extractor:
Visualize the features of a subset of the MNIST dataset:
Image generation
Extract the image reconstruction part:
Extract the DigitCaps feature vector for a given digit image:
Reconstruct the image from the feature vector:
Experiment with changing the feature vector. Add a shift along a single coordinate at a time:
Training the uninitialized architecture
Retrieve the uninitialized training architecture:
Retrieve the MNIST dataset:
Use the training dataset provided:
Use the test dataset provided:
Initialize the “W” matrices properly:
Train the net (if a GPU is available, setting TargetDevice -> "GPU" is recommended):
Net information
Inspect the number of parameters of all arrays in the net:
Obtain the total number of parameters:
Obtain the layer type counts:
Display the summary graphic:
Export to MXNet
Export the net into a format that can be opened in MXNet:
Export also creates a net.params file containing parameters:
Get the size of the parameter file:
The size is similar to the byte count of the resource object:
Represent the MXNet net as a graph: