The following functions are used within nntoolkit.
Utility functions that can be used in multiple scripts.
Create boilerplate files which can contain semantic meaningful values.
| Parameters: | neurons – A list which gives the number of neurons per layer. The first value of this list is the number of input neurons, the last value is the number of output neurons. |
|---|
Create semantic input and output files which can contain semantic meaningful values.
| Parameters: | model (dict) – A neural network model |
|---|
Get data as x and y numpy arrays for a tar archive.
| Parameters: | training_data – The path to a tar file. |
|---|---|
| Returns: | Tuple (x, y), where y might be None in case of success or False in case of error |
Check if modelfile is valid.
| Parameters: | modelfile – path to a model.tar file which describes a neural network. |
|---|---|
| Returns: | A dictionary which describes the model if everything seems to be fine. Return False if errors occur. |
Parse output_file which is a csv file and defines the semantics of the output of a neural network.
For example, output neuron 1 means class “0” in the MNIST classification task.
Check if arg is a valid file that already exists on the file system.