Module containing the network class used to define a neural network
This module contains the types and interfaces for the network class used to define a neural network. The network class is used to define a neural network with overloaded procedures for training, testing, predicting, and updating the network. The network class is also used to define the network structure and compile the network with an optimiser, loss function, and accuracy function.
Interface for setting up the network (network initialisation)
Set up the network
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(container_layer_type), | intent(in), | dimension(:) | :: | layers |
Layers |
|
| class(base_optimiser_type), | intent(in), | optional | :: | optimiser |
Optimiser |
|
| class(*), | intent(in), | optional | :: | loss_method |
Loss method |
|
| character(len=*), | intent(in), | optional | :: | accuracy_method |
Accuracy method |
|
| class(*), | intent(in), | optional, | dimension(..) | :: | metrics |
Metrics |
| integer, | intent(in), | optional | :: | batch_size |
Batch size |
Instance of the network
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Get the accuracy for the output
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(in) | :: | this |
Instance of network |
||
| class(*), | intent(in), | dimension(:,:) | :: | output |
Output |
|
| integer, | intent(in) | :: | start_index |
Start and end batch indices |
||
| integer, | intent(in) | :: | end_index |
Start and end batch indices |
Accuracy value
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Add a layer to the network
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| class(base_layer_type), | intent(in) | :: | layer |
Layer to add |
||
| integer, | intent(in), | optional, | dimension(:) | :: | input_list |
Input and output list |
| integer, | intent(in), | optional, | dimension(:) | :: | output_list |
Input and output list |
| class(*), | intent(in), | optional | :: | operator |
Operator |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Build network from ONNX nodes and initialisers
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| type(onnx_node_type), | intent(in), | dimension(:) | :: | nodes |
Array of ONNX nodes |
|
| type(onnx_initialiser_type), | intent(in), | dimension(:) | :: | initialisers |
Array of ONNX initialisers |
|
| type(onnx_tensor_type), | intent(in), | dimension(:) | :: | inputs |
Array of ONNX input tensors |
|
| type(onnx_tensor_type), | intent(in), | dimension(:) | :: | value_info |
Array of ONNX value info tensors |
|
| integer, | intent(in), | optional | :: | verbose |
Verbosity level |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Calculate output vertices
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Calculate root vertices
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Generate vertex order
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Compile the network
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| class(base_optimiser_type), | intent(in), | optional | :: | optimiser |
Optimiser |
|
| class(*), | intent(in), | optional | :: | loss_method |
Loss method |
|
| character(len=*), | intent(in), | optional | :: | accuracy_method |
Accuracy method |
|
| class(*), | intent(in), | optional, | dimension(..) | :: | metrics |
Metrics |
| integer, | intent(in), | optional | :: | batch_size |
Batch size |
|
| integer, | intent(in), | optional | :: | verbose |
Verbosity level |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Depth first search
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(in) | :: | this |
Instance of the network |
||
| integer, | intent(in) | :: | vertex_index |
Vertex index |
||
| logical, | intent(inout), | dimension(this%auto_graph%num_vertices) | :: | visited |
Visited vertices |
|
| integer, | intent(inout), | dimension(this%auto_graph%num_vertices) | :: | order |
Order of vertices |
|
| integer, | intent(inout) | :: | order_index |
Index of order |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(in) | :: | this |
Instance of network |
||
| real(kind=real32), | intent(out), | dimension(..), allocatable | :: | output |
Output |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Forward pass evaluation
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout), | target | :: | this |
Instance of the network |
|
| class(*), | intent(in), | dimension(:,:) | :: | input |
Input data |
Output data
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Forward pass evaluation for multiple outputs
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout), | target | :: | this |
Instance of the network |
|
| class(*), | intent(in), | dimension(:,:) | :: | input |
Input data |
Output data
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Forward pass for generic 2D input
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout), | target | :: | this |
Instance of the network |
|
| class(*), | intent(in), | dimension(:,:) | :: | input |
Input data |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Get gradients of learnable parameters
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(in) | :: | this |
Instance of the network |
Gradients
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Get number of learnable parameters in the network
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(in) | :: | this |
Instance of the network |
Number of parameters
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(in) | :: | this |
Instance of the network |
Output
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(in) | :: | this |
Instance of the network |
Output shape
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Get learnable parameters
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(in) | :: | this |
Instance of the network |
Learnable parameters
Get sample for mixed input
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(array_type), | intent(in), | dimension(:,:) | :: | input |
Input array |
|
| integer, | intent(in) | :: | start_index |
Start and end indices |
||
| integer, | intent(in) | :: | end_index |
Start and end indices |
||
| integer, | intent(in) | :: | batch_size |
Batch size |
||
| logical, | intent(in) | :: | as_graph |
Boolean whether to treat the input as a graph |
Sample array
Get a sample from a rank
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in), | dimension(..) | :: | input |
Input array |
|
| integer, | intent(in) | :: | start_index |
Start and end indices |
||
| integer, | intent(in) | :: | end_index |
Start and end indices |
||
| integer, | intent(in) | :: | batch_size |
Batch size |
Sample array
Get sample for graph input
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(graph_type), | intent(in), | dimension(:) | :: | input |
Input array |
|
| integer, | intent(in) | :: | start_index |
Start and end indices |
||
| integer, | intent(in) | :: | end_index |
Start and end indices |
||
| integer, | intent(in) | :: | batch_size |
Batch size |
Sample array
Get sample for graph input
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(graph_type), | intent(in), | dimension(:,:) | :: | input |
Input array |
|
| integer, | intent(in) | :: | start_index |
Start and end indices |
||
| integer, | intent(in) | :: | end_index |
Start and end indices |
||
| integer, | intent(in) | :: | batch_size |
Batch size |
Sample array
Get a sample from a rank
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=real32), | intent(in), | dimension(..), target | :: | input |
Input array |
|
| integer, | intent(in) | :: | start_index |
Start and end indices |
||
| integer, | intent(in) | :: | end_index |
Start and end indices |
||
| integer, | intent(in) | :: | batch_size |
Batch size |
Pointer to sample
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Optimise input to match a target output (array_type inputs)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout), | target | :: | this |
Instance of the network |
|
| type(array_type), | intent(in) | :: | target |
Target output values |
||
| type(array_type), | intent(in) | :: | x_init |
Initial input values |
||
| class(base_optimiser_type), | intent(in), | optional | :: | optimiser |
Optimiser for input updates (defaults to network optimiser) |
|
| integer, | intent(in) | :: | steps |
Number of optimisation iterations |
Optimised input
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Optimise input to match a target output (array_type inputs)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout), | target | :: | this |
Instance of the network |
|
| type(array_type), | intent(in), | dimension(:,:) | :: | target |
Target output values |
|
| type(array_type), | intent(in), | dimension(:,:) | :: | x_init |
Initial input values |
|
| class(base_optimiser_type), | intent(in), | optional | :: | optimiser |
Optimiser for input updates (defaults to network optimiser) |
|
| integer, | intent(in) | :: | steps |
Number of optimisation iterations |
Optimised input
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Optimise input to match a target output (real inputs)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout), | target | :: | this |
Instance of the network |
|
| real(kind=real32), | intent(in), | dimension(:,:) | :: | target |
Target output values |
|
| real(kind=real32), | intent(in), | dimension(:,:) | :: | x_init |
Initial input values |
|
| class(base_optimiser_type), | intent(in), | optional | :: | optimiser |
Optimiser for input updates (defaults to network optimiser) |
|
| integer, | intent(in) | :: | steps |
Number of optimisation iterations |
Optimised input
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Get the layer of the network from its ID
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(in), | target | :: | this |
Instance of the network |
|
| integer, | intent(in) | :: | id |
Layer ID |
Layer pointer
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Get the loss for the output
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout), | target | :: | this |
Instance of network |
|
| integer, | intent(in) | :: | start_index |
Start and end batch indices |
||
| integer, | intent(in) | :: | end_index |
Start and end batch indices |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Copy a network
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| type(network_type), | intent(in), | target | :: | source |
Source network |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Reduce two networks down to one (i.e. add two networks - parallel)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| type(network_type), | intent(in) | :: | source |
Source network |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Nullify graph data in the network to free memory
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Hook called after each training epoch. The default implementation is a no-op; override in a derived type to add custom per-epoch behaviour (e.g. W&B metric logging).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| integer, | intent(in) | :: | epoch |
Current epoch number (1-based) |
||
| real(kind=real32), | intent(in) | :: | loss |
Current loss value |
||
| real(kind=real32), | intent(in) | :: | accuracy |
Current accuracy value |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Predict the output for a generic input
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of network |
||
| class(array_type), | intent(in), | dimension(..) | :: | input |
Input graph |
|
| integer, | intent(in), | optional | :: | verbose |
Verbosity level |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Get predicted results as array from supplied inputs using the trained network
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| class(*), | intent(in), | dimension(..) | :: | input |
Input data |
|
| logical, | intent(in) | :: | output_as_array |
Whether to output as array |
||
| integer, | intent(in), | optional | :: | verbose |
Verbosity level |
Predicted output data as array
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Predict the output for a generic input
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of network |
||
| class(*), | intent(in), | dimension(:,:) | :: | input |
Input graph |
|
| integer, | intent(in), | optional | :: | verbose |
Verbosity level |
|
| logical, | intent(in), | optional | :: | output_as_graph |
Boolean whether to output as graph |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Get predicted results from supplied inputs using the trained network
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| type(graph_type), | intent(in), | dimension(:) | :: | input |
Input data |
|
| integer, | intent(in), | optional | :: | verbose |
Verbosity level |
Predicted output data
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Get predicted results from supplied inputs using the trained network
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| type(graph_type), | intent(in), | dimension(:,:) | :: | input |
Input data |
|
| integer, | intent(in), | optional | :: | verbose |
Verbosity level |
Predicted output data
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Get predicted results from supplied inputs using the trained network
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| real(kind=real32), | intent(in), | dimension(..) | :: | input |
Input data |
|
| integer, | intent(in), | optional | :: | verbose |
Verbosity level |
Predicted output data
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Print the network to file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(in) | :: | this |
Instance of the network |
||
| character(len=*), | intent(in) | :: | file |
File name |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Print a summary of the network architecture
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(in) | :: | this |
Instance of the network |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Read the network from a file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| character(len=*), | intent(in) | :: | file |
File name |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Read network settings from a file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| integer, | intent(in) | :: | unit |
Unit number for input |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Read optimiser settings from a file
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| integer, | intent(in) | :: | unit |
Unit number for input |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Reset the network
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Reset learnable parameter gradients
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Reset hidden state of recurrent layers
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Restore the training/inference mode of layers to the values stored in mode_store. This is used after temporarily switching modes for prediction or evaluation on a training batch.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| logical, | intent(in), | dimension(:) | :: | mode_store |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Convert and save polymorphic input to array or graph
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of network |
||
| class(*), | intent(in), | dimension(..) | :: | input |
Input |
Number of samples
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Convert and save polymorphic output to array or graph
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of network |
||
| class(*), | intent(in), | dimension(:,:) | :: | output |
Output |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Set network accuracy method
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| character(len=*), | intent(in) | :: | accuracy_method |
Accuracy method |
||
| integer, | intent(in), | optional | :: | verbose |
Verbosity level |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Set batch size
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| integer, | intent(in) | :: | batch_size |
Batch size |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Set learnable parameter gradients
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| real(kind=real32), | intent(in), | dimension(..) | :: | gradients |
Gradients |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Put the network in inference mode. Layers such as dropout and batch normalisation use their inference behaviour after this call.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| logical, | intent(out), | optional, | dimension(:), allocatable | :: | mode_store |
Optional array to store the training mode of each layer |
| integer, | intent(in), | optional, | dimension(:) | :: | layer_indices |
Optional array of layer indices to set to inference mode. |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Set network loss method
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| class(*), | intent(in) | :: | loss_method |
Loss method |
||
| integer, | intent(in), | optional | :: | verbose |
Verbosity level |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Set network metrics
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| class(*), | intent(in), | dimension(..) | :: | metrics |
Metrics |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Set learnable parameters
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| real(kind=real32), | intent(in), | dimension(this%num_params) | :: | params |
Learnable parameters |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Put the network in training mode. Layers such as dropout and batch normalisation use their training behaviour after this call.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| logical, | intent(out), | optional, | dimension(:), allocatable | :: | mode_store |
Optional array to store the training mode of each layer |
| integer, | intent(in), | optional, | dimension(:) | :: | layer_indices |
Optional array of layer indices to set to training mode. |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Test the network
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| class(*), | intent(in), | dimension(..) | :: | input |
Input data |
|
| class(*), | intent(in), | dimension(:,:) | :: | output |
Expected output data (data labels) |
|
| integer, | intent(in), | optional | :: | verbose |
Verbosity level |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Train the network
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
||
| class(*), | intent(in), | dimension(..) | :: | input |
Input data |
|
| class(*), | intent(in), | dimension(:,:) | :: | output |
Expected output data (data labels) |
|
| integer, | intent(in) | :: | num_epochs |
Number of epochs to train for |
||
| integer, | intent(in), | optional | :: | batch_size |
Batch size (DEPRECATED) |
|
| real(kind=real32), | intent(in), | optional | :: | plateau_threshold |
Threshold for checking learning plateau |
|
| logical, | intent(in), | optional | :: | shuffle_batches |
Shuffle batch order |
|
| integer, | intent(in), | optional | :: | batch_print_step |
Print step for batch |
|
| integer, | intent(in), | optional | :: | verbose |
Verbosity level |
|
| integer, | intent(in), | optional | :: | print_precision |
Number of decimal places to print for training metrics |
|
| logical, | intent(in), | optional | :: | scientific_print |
Whether to print training metrics in scientific notation |
|
| logical, | intent(in), | optional | :: | early_stopping |
Whether to stop training early if learning plateau is detected |
|
| class(*), | intent(in), | optional, | dimension(..) | :: | val_input |
Validation input data |
| class(*), | intent(in), | optional, | dimension(:,:) | :: | val_output |
Validation expected output data |
Interface for printing the network to file Interface for printing a summary of the network Interface for reading the network from a file Interface for reading network settings from a file Interface for reading optimiser settings from a file Interface for building network from ONNX nodes and initialisers Interface for adding a layer to the network Interface for resetting the network Interface for compiling the network Interface for setting batch size Interface for setting network metrics Interface for setting network loss method Interface for setting network accuracy method Interface for resetting state of recurrent layers Interface for saving input to network Interface for saving output to network Interface for training the network Interface for testing the network Interface for returning predicted results from supplied inputs using the trained network Interface for returning predicted results from supplied inputs using the trained network (graph input) Interface for updating the learnable parameters of the network based on gradients Interface for generating vertex order Interface for depth first search Interface for calculating root vertices Interface for calculating output vertices Interface for reducing two networks down to one (i.e. add two networks - parallel) Interface for copying a network Interface for getting number of learnable parameters in the network Interface for getting learnable parameters Interface for setting learnable parameters Interface for getting gradients of learnable parameters Interface for setting learnable parameter gradients Interface for resetting learnable parameter gradients Interface for forward pass
Update the learnable parameters of the network based on gradients
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(network_type), | intent(inout) | :: | this |
Instance of the network |
Type for defining a neural network with overloaded procedures
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | public, | allocatable | :: | accuracy_method |
Loss and accuracy method names |
||
| real(kind=real32), | public | :: | accuracy_val |
Accuracy and loss of the network |
|||
| type(graph_type), | public | :: | auto_graph |
Graph structure for the network |
|||
| integer, | public | :: | batch_size | = | 0 |
Batch size |
|
| integer, | public | :: | epoch | = | 0 |
Epoch number |
|
| type(array_type), | public, | dimension(:,:), allocatable | :: | expected_array |
Expected output array for the network |
||
| integer, | public, | dimension(:), allocatable | :: | fwd_layer_id |
Layer ID for each vertex in forward order |
||
| integer, | public, | dimension(:), allocatable | :: | fwd_layer_type |
Layer type: 0=input, 1=merge, 2=default |
||
| integer, | public, | dimension(:), allocatable | :: | fwd_num_inputs |
Number of input layers for each vertex in forward order |
||
| integer, | public, | dimension(:), allocatable | :: | fwd_parent_id |
Parent layer ID for single-input vertices |
||
| procedure(compute_accuracy_function), | public, | nopass, pointer | :: | get_accuracy | => | null() |
Pointer to accuracy function |
| type(array_type), | public, | dimension(:,:), allocatable | :: | input_array |
Input array for the network |
||
| type(graph_type), | public, | dimension(:,:), allocatable | :: | input_graph |
Input graph for the network |
||
| integer, | public, | dimension(:), allocatable | :: | leaf_vertices |
Root and output vertices |
||
| class(base_loss_type), | public, | allocatable | :: | loss |
Loss method for the network |
||
| character(len=:), | public, | allocatable | :: | loss_method |
Loss and accuracy method names |
||
| real(kind=real32), | public | :: | loss_val |
Accuracy and loss of the network |
|||
| type(metric_dict_type), | public, | dimension(2) | :: | metrics |
Metrics for the network |
||
| type(container_layer_type), | public, | allocatable, dimension(:) | :: | model |
Model layers |
||
| character(len=:), | public, | allocatable | :: | name |
Name of the network |
||
| integer, | public | :: | num_layers | = | 0 |
Number of layers |
|
| integer, | public | :: | num_outputs | = | 0 |
Number of outputs |
|
| integer, | public | :: | num_params | = | 0 |
Number of parameters |
|
| class(base_optimiser_type), | public, | allocatable | :: | optimiser |
Optimiser for the network |
||
| integer, | public | :: | param_num_segments | = | 0 |
Number of parameter segments |
|
| integer, | public, | dimension(:), allocatable | :: | param_seg_end |
End offset in flat parameter array |
||
| integer, | public, | dimension(:), allocatable | :: | param_seg_layer |
Layer index for each parameter segment |
||
| integer, | public, | dimension(:), allocatable | :: | param_seg_pidx |
Param index within that layer for each segment |
||
| integer, | public, | dimension(:), allocatable | :: | param_seg_start |
Start offset in flat parameter array |
||
| integer, | public, | dimension(:), allocatable | :: | root_vertices |
Root and output vertices |
||
| logical, | public | :: | use_graph_input | = | .false. |
Boolean flag for graph input |
|
| logical, | public | :: | use_graph_output | = | .false. |
Boolean flag for graph output |
|
| integer, | public, | dimension(:), allocatable | :: | vertex_order |
Order of vertices |
Interface for setting up the network (network initialisation)
| private module function network_setup (layers, optimiser, loss_method, accuracy_method, metrics, batch_size) | Set up the network |
| procedure, public, pass(this) :: accuracy_eval | Get the accuracy for the output |
| procedure, public, pass(this) :: add | Add a layer to the network |
| procedure, public, pass(this) :: build_from_onnx | Build network from ONNX nodes and initialisers |
| procedure, public, pass(this) :: compile | Compile the network |
| procedure, public, pass(this) :: copy => network_copy | Copy a network |
| procedure, public, pass(this) :: extract_output => extract_output_real | Extract network output as real array (only works for single output layer models) |
| procedure, public, pass(this) :: forward => forward_generic2d | Forward pass for generic 2D input |
| procedure, public, pass(this) :: forward_eval | Forward pass and return pointer to output (only works for single output layer models) |
| procedure, public, pass(this) :: get_gradients | Get gradients of learnable parameters |
| procedure, public, pass(this) :: get_num_params | Get number of learnable parameters in the network |
| procedure, public, pass(this) :: get_output | Get the output of the network |
| procedure, public, pass(this) :: get_output_shape | Get the output shape of the network |
| procedure, public, pass(this) :: get_params | Get learnable parameters |
| generic, public :: inverse_design => inverse_design_real, inverse_design_array_0d, inverse_design_array_2d | Optimise input to match a target output |
| procedure, public, pass(this) :: layer_from_id | Get the layer of the network from its ID |
| procedure, public, pass(this) :: loss_eval | Get the loss for the output |
| procedure, public, pass(this) :: nullify_graph | Nullify graph data in the network to free memory |
| procedure, public, pass(this) :: post_epoch_hook | Called after each training epoch; override in derived types for custom per-epoch callbacks (e.g. logging to Weights & Biases). |
| generic, public :: predict => predict_real, predict_graph1d, predict_graph2d, predict_array, predict_array_from_real | Predict function for different input types |
| procedure, public, pass(this) :: predict_array | Predict array type output for a generic input |
| procedure, public, pass(this) :: predict_array_from_real | Return predicted results as array from supplied inputs using the trained network |
| procedure, public, pass(this) :: predict_generic | Predict generic type output for a generic input |
| procedure, public, pass(this) :: predict_graph1d | |
| procedure, public, pass(this) :: predict_graph2d | Return predicted results from supplied inputs using the trained network (graph input) |
| procedure, public, pass(this) :: predict_real | Return predicted results from supplied inputs using the trained network |
| procedure, public, pass(this) :: print | Print the network to file |
| procedure, public, pass(this) :: print_summary | Print a summary of the network architecture |
| procedure, public, pass(this) :: read | Read the network from a file |
| procedure, public, pass(this) :: reduce => network_reduction | Reduce two networks down to one (i.e. add two networks - parallel) |
| procedure, public, pass(this) :: reset | Reset the network |
| procedure, public, pass(this) :: reset_gradients | Reset learnable parameter gradients |
| procedure, public, pass(this) :: reset_state | Reset hidden state of recurrent layers |
| procedure, public, pass(this) :: save_input => save_input_to_network | Convert and save polymorphic input to array or graph |
| procedure, public, pass(this) :: save_output => save_output_to_network | Convert and save polymorphic output to array or graph |
| procedure, public, pass(this) :: set_accuracy | Set network accuracy method |
| procedure, public, pass(this) :: set_batch_size | Set batch size |
| procedure, public, pass(this) :: set_gradients | Set learnable parameter gradients |
| procedure, public, pass(this) :: set_inference_mode | Set inference mode for layers with training/inference-specific behaviour |
| procedure, public, pass(this) :: set_loss | Set network loss method |
| procedure, public, pass(this) :: set_metrics | Set network metrics |
| procedure, public, pass(this) :: set_params | Set learnable parameters |
| procedure, public, pass(this) :: set_training_mode | Set training mode for layers with training/inference-specific behaviour |
| procedure, public, pass(this) :: test | Test the network |
| procedure, public, pass(this) :: train | Train the network |
| procedure, public, pass(this) :: update | Update the learnable parameters of the network based on gradients |
| procedure, private, pass(this) :: build_leaf_vertices | Calculate output vertices |
| procedure, private, pass(this) :: build_root_vertices | Calculate root vertices |
| procedure, private, pass(this) :: build_vertex_order | Generate vertex order |
| procedure, private, pass(this) :: dfs | Depth first search |
| procedure, private, pass(this) :: inverse_design_array_0d | Inverse design with 0d array_type inputs |
| procedure, private, pass(this) :: inverse_design_array_2d | Inverse design with 2d array_type inputs |
| procedure, private, pass(this) :: inverse_design_real | Inverse design with real inputs |
| procedure, private, pass(this) :: read_network_settings | Read network settings from a file |
| procedure, private, pass(this) :: read_optimiser_settings | Read optimiser settings from a file |
| procedure, private, pass(this) :: restore_mode | Reset the training/inference mode of layers to the values stored in mode_store. |