Define an abstraction that supports inference operations on a neural network
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t(double_precision)), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(string_t), | intent(in) | :: | metadata(:) | |||
real, | intent(in) | :: | weights(:,:,:) | |||
real, | intent(in) | :: | biases(:,:) | |||
integer, | intent(in) | :: | nodes(0:) | |||
type(tensor_map_t), | intent(in), | optional | :: | input_map | ||
type(tensor_map_t), | intent(in), | optional | :: | output_map |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(file_t), | intent(in) | :: | file_ |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(metadata_t), | intent(in) | :: | metadata | |||
double precision, | intent(in) | :: | weights(:,:,:) | |||
double precision, | intent(in) | :: | biases(:,:) | |||
integer, | intent(in) | :: | nodes(0:) | |||
type(tensor_map_t(double_precision)), | intent(in), | optional | :: | input_map | ||
type(tensor_map_t(double_precision)), | intent(in), | optional | :: | output_map |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(double_precision_file_t), | intent(in) | :: | file |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(double_precision_file_t), | intent(in) | :: | file |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(neural_network_t), | intent(in) | :: | neural_network |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(workspace_t), | intent(inout) | :: | self | |||
type(neural_network_t), | intent(in) | :: | neural_network |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(workspace_t), | intent(in) | :: | self |
The result is true if lhs and rhs are the same to within a tolerance
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t), | intent(in) | :: | lhs | |||
class(neural_network_t), | intent(in) | :: | rhs |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t), | intent(in) | :: | self | |||
type(tensor_t), | intent(in) | :: | inputs |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(unmapped_network_t), | intent(in) | :: | self | |||
type(tensor_t), | intent(in) | :: | inputs |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t), | intent(inout) | :: | self | |||
type(mini_batch_t), | intent(in) | :: | mini_batches_arr(:) | |||
real, | intent(out), | optional, | allocatable | :: | cost(:) | |
logical, | intent(in) | :: | adam | |||
real, | intent(in) | :: | learning_rate | |||
type(workspace_t), | intent(inout) | :: | workspace |
The result contains the output tensor values unmapped via the inverse of the mapping used in training
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t), | intent(in) | :: | self | |||
type(tensor_t), | intent(in) | :: | normalized_tensor |
The result contains the input tensor values normalized to fall on the range used during training
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t), | intent(in) | :: | self | |||
type(tensor_t), | intent(in) | :: | tensor |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t(double_precision)), | intent(in) | :: | self |
The result is true if lhs and rhs are the same to within a tolerance
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t(double_precision)), | intent(in) | :: | lhs | |||
class(neural_network_t(double_precision)), | intent(in) | :: | rhs |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t(double_precision)), | intent(in) | :: | self | |||
type(tensor_t(double_precision)), | intent(in) | :: | inputs |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(unmapped_network_t(double_precision)), | intent(in) | :: | self | |||
type(tensor_t(double_precision)), | intent(in) | :: | inputs |
The result contains the output tensor values unmapped via the inverse of the mapping used in training
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t(double_precision)), | intent(in) | :: | self | |||
type(tensor_t(double_precision)), | intent(in) | :: | normalized_tensor |
The result contains the input tensor values normalized to fall on the range used during training
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t(double_precision)), | intent(in) | :: | self | |||
type(tensor_t(double_precision)), | intent(in) | :: | tensor |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t(double_precision)), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t(double_precision)), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t(double_precision)), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t(double_precision)), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t(double_precision)), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(neural_network_t(double_precision)), | intent(in) | :: | self |
Encapsulate the information needed to perform inference
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | kind | :: | k | = | default_real | |
type(activation_t), | private | :: | activation_ | ||||
real(kind=k), | private, | allocatable | :: | biases_(:,:) | |||
type(tensor_map_t(k)), | private | :: | input_map_ | ||||
type(metadata_t), | private | :: | metadata_ | ||||
integer, | private, | allocatable | :: | nodes_(:) | |||
type(tensor_map_t(k)), | private | :: | output_map_ | ||||
real(kind=k), | private, | allocatable | :: | weights_(:,:,:) |
private module function default_real_construct_from_components (metadata, weights, biases, nodes, input_map, output_map) | |
private impure, elemental, module function default_real_from_json (file_) | |
private module function double_precision_construct_from_components (metadata, weights, biases, nodes, input_map, output_map) | |
private impure, elemental, module function double_precision_from_json (file) |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public, | kind | :: | k | = | default_real | |
type(neural_network_t(k)), | private | :: | neural_network_ |
private impure, elemental, module function double_precision_unmapped_from_json (file) |
generic, public :: infer => default_real_infer_unmapped, double_precision_infer_unmapped | |
procedure, private, non_overridable :: default_real_infer_unmapped | |
procedure, private, non_overridable :: double_precision_infer_unmapped |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=k), | public, | allocatable, dimension(:,:) | :: | a | |||
real(kind=k), | public, | allocatable, dimension(:,:) | :: | dcdb | |||
real(kind=k), | public, | allocatable, dimension(:,:,:) | :: | dcdw | |||
real(kind=k), | public, | allocatable, dimension(:,:) | :: | delta | |||
integer, | public, | kind | :: | k | = | default_real | |
real(kind=k), | public, | allocatable, dimension(:,:) | :: | sdb | |||
real(kind=k), | public, | allocatable, dimension(:,:) | :: | sdbc | |||
real(kind=k), | public, | allocatable, dimension(:,:,:) | :: | sdw | |||
real(kind=k), | public, | allocatable, dimension(:,:,:) | :: | sdwc | |||
real(kind=k), | public, | allocatable, dimension(:,:) | :: | vdb | |||
real(kind=k), | public, | allocatable, dimension(:,:) | :: | vdbc | |||
real(kind=k), | public, | allocatable, dimension(:,:,:) | :: | vdw | |||
real(kind=k), | public, | allocatable, dimension(:,:,:) | :: | vdwc | |||
real(kind=k), | public, | allocatable, dimension(:,:) | :: | z |
private pure, module function default_real_workspace (neural_network) |
generic, public :: allocate_if_necessary => default_real_allocate | |
generic, public :: fully_allocated => default_real_allocated | |
procedure, private, non_overridable :: default_real_allocate | |
procedure, private, non_overridable :: default_real_allocated |