Create Neural Network Model File

A neural network can be stored in a so called ‘model file’. A (randomly initialized) network model file can be created with this module.

Create a neural network model file.

nntoolkit.create.create_hdf5s_for_layer(i, layer)[source]

Create one HDF5 file for the weight matrix W and one for the bias vector b.

nntoolkit.create.create_layers(neurons)[source]

Create the layers of the neural network.

Parameters:neurons – A list of integers which indicates how many neurons are in which layer
Returns:a list of dictionaries with random variables for the weight matrix W and the bias vector b
nntoolkit.create.get_parser()[source]

Return the parser object for this script.

nntoolkit.create.is_valid_model_file(model_file_path)[source]

Check if model_file_path is a valid model file.

nntoolkit.create.main(nn_type, architecture, model_file)[source]

Create a neural network file of nn_type with architecture. Store it in model_file.

Parameters:
  • nn_type – A string, e.g. ‘mlp’
  • model_file – A path which should end with .tar. The created model will be written there.
nntoolkit.create.xaviar10_weight_init(neurons_a, neurons_b)[source]

Initialize the weights between a layer with neurons_a neurons and a layer with neurons_b neurons.

Returns:A neurons_a × neurons_b matrix.

Previous topic

Data File Format

Next topic

Train Neural Networks

This Page