Convenience module for loading all loss functions.
This module provides a centralized factory interface for creating
and accessing different types of loss functions used in RuNNer.
It serves as a registry and factory for all available loss function
implementations.
Available loss functions:
- Mean Absolute Error (MAE) - L1 loss, robust to outliers
- Mean Squared Error (MSE) - L2 loss, commonly used for regression
- Root Mean Squared Error (RMSE) - Square root of MSE
Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Factory function to create loss function objects by index.
Creates and returns a polymorphic pointer to the requested loss function
type. The function acts as a factory, instantiating the appropriate
concrete loss function based on the provided index.
loss_function_index - Numeric identifier for the loss function type
collect - Whether to collect/average values across MPI processes
Returns: Polymorphic pointer to the created loss function
Arguments
loss_function_index :
integer [in]– Loss function type identifier
collect :
logical [in]– Whether to average across MPI processes
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Convert loss function name string to numeric index.
This function maps loss function names (as strings) to their
corresponding numeric identifiers. It's typically used when parsing
input files that specify loss functions by name.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.