Class to represent a two level self_organized_map
Constructor of a two_level self_organized_map class
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(two_level_self_organizing_map) | :: | kohonen_map | 
 A   | 
        |||
| type(kohonen_layer_parameters), | dimension(:) | :: | training_parameters | 
 A   | 
        
Destructor of a two_level self_organized_map
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(two_level_self_organizing_map) | :: | kohonen_map | 
 A   | 
        
Subroutine to train a two_level self_organized_map
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(two_level_self_organizing_map) | :: | kohonen_map | 
 A   | 
        |||
| type(kohonen_pattern), | intent(inout), | dimension(:) | :: | input_data | 
 A   | 
        
Subroutine to make a prediction from a trained two_level self_organized_map
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(two_level_self_organizing_map) | :: | kohonen_map | 
 A   | 
        |||
| type(kohonen_pattern), | intent(inout), | dimension(:) | :: | input_data | 
 A   | 
        |
| integer, | intent(out), | dimension(:,:) | :: | map_output | 
 An integer array  | 
        
Subroutine to train the grid layer of a two_level self_organized_map
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(two_level_self_organizing_map) | :: | kohonen_map | 
 A   | 
        |||
| type(kohonen_pattern), | intent(inout), | dimension(:) | :: | input_data | 
 A   | 
        
Subroutine to train the cluster layer of a two_level self_organized_map
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(two_level_self_organizing_map) | :: | kohonen_map | 
 A   | 
        
Subroutine to print the layers of a two_level self_organized_map
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(two_level_self_organizing_map) | :: | kohonen_map | 
 A   | 
        |||
| integer, | optional | :: | unit_ | 
 An integer variable with the unit  | 
        
Function to find the input samples associated with specific vector
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(two_level_self_organizing_map) | :: | kohonen_map | 
 A   | 
        |||
| real(kind=wp), | intent(inout), | dimension(:,:) | :: | input_pattern | 
 A real array  | 
        |
| integer, | allocatable | :: | sample_index(:) | 
 An integer array  | 
        
Subroutine to initialize the cluster layer of a Two Level Self-Organizing Map
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(two_level_self_organizing_map) | :: | kohonen_map | 
 A   | 
        |||
| integer | :: | seed | 
 An integer variable with the random seed  | 
        
Subroutine to set parameters
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(two_level_self_organizing_map) | :: | kohonen_map | 
 A   | 
        |||
| type(kohonen_layer_parameters), | dimension(2) | :: | training_parameters | 
Subroutine to read the prototypes of the first/seconf layer of a two level self_organized_map
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(two_level_self_organizing_map) | :: | kohonen_map | 
 A   | 
        |||
| character(len=*) | :: | som_fl | 
 A character variable  | 
        |||
| character(len=*) | :: | layer_type | 
 A character variable  | 
        
Subroutine to calculate some clustering statistics of a two-level self_organized_map
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(two_level_self_organizing_map) | :: | kohonen_map | 
 A   | 
        |||
| type(kohonen_pattern), | intent(inout), | dimension(:) | :: | input_data | 
 A   | 
        |
| real(kind=wp), | optional, | dimension(:) | :: | results | 
 A real array  | 
        
Accessor to cluster results obtained using a two-level self_organized_map
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(two_level_self_organizing_map) | :: | kohonen_map | 
 A   | 
        |||
| integer, | intent(inout), | dimension(:) | :: | clusters | 
 An integer array  | 
        
Subroutine to calculate some clustering statistics of a two-level self_organized_map
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(two_level_self_organizing_map) | :: | kohonen_map | 
 A   | 
        |||
| real(kind=wp), | optional, | dimension(:) | :: | results | 
 A real array  | 
        
Subroutine to connect the two_level_self_organizing_map module to R o C Use iso_c_binding module
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=c_double), | intent(in) | :: | x(npat,nvar) | 
 Real variables  | 
        ||
| integer(kind=c_int), | intent(in) | :: | nvar | 
 Integere variables  | 
        ||
| integer(kind=c_int), | intent(in) | :: | npat | 
 Integere variables  | 
        ||
| integer(kind=c_int), | intent(in) | :: | som_type | 
 Integere variables  | 
        ||
| integer(kind=c_int), | intent(in) | :: | nx1 | 
 Integere variables  | 
        ||
| integer(kind=c_int), | intent(in) | :: | ny1 | 
 Integere variables  | 
        ||
| integer(kind=c_int), | intent(in) | :: | nepoch1 | 
 Integere variables  | 
        ||
| real(kind=c_double), | intent(in) | :: | alpha1 | 
 Real variables  | 
        ||
| integer(kind=c_int), | intent(in) | :: | grid_type1 | 
 Integer variables  | 
        ||
| integer(kind=c_int), | intent(in) | :: | distance_type1 | 
 Integer variables  | 
        ||
| integer(kind=c_int), | intent(in) | :: | neigh_type1 | 
 Integer variables  | 
        ||
| integer(kind=c_int), | intent(in) | :: | toroidal1 | 
 Integere variables  | 
        ||
| integer(kind=c_int), | intent(in) | :: | nx2 | 
 Integer variables  | 
        ||
| integer(kind=c_int), | intent(in) | :: | nepoch2 | 
 Integer variables  | 
        ||
| real(kind=c_double), | intent(in) | :: | alpha2 | 
 Real variables  | 
        ||
| integer(kind=c_int), | intent(in) | :: | grid_type2 | 
 Integer variables  | 
        ||
| real(kind=c_double), | intent(out) | :: | prot(nx1*ny1,nvar) | 
 Real variables  | 
        ||
| real(kind=c_double), | intent(out) | :: | distortion(nepoch1) | 
 Real variables  | 
        ||
| real(kind=c_double), | intent(out) | :: | u_matrix(2*nx1-1,2*ny1-1) | 
 Real variables  | 
        ||
| real(kind=c_double), | intent(out) | :: | coords(nx1*ny1,3) | 
 Real variables  | 
        ||
| integer(kind=c_int), | intent(out) | :: | number_patterns(nx1,ny1) | 
 Integer variables  | 
        ||
| integer(kind=c_int), | intent(out) | :: | node_index(npat,3) | 
 Integer variables  | 
        
type,extends(kohonen_map_base) :: two_level_self_organizing_map private !! Class to represent a two level self_organized_map type(kohonen_prototype),allocatable :: grid(:,:,:),cluster_layer(:) real(kind=wp),allocatable :: coordinates(:,:) integer,allocatable :: number_patterns(:,:,:),cells_index(:,:) integer,allocatable :: cluster_number_patterns(:),cluster_cells_index(:,:) integer,allocatable :: grid_cluster(:,:,:),cluster_samples(:) real(kind=wp),allocatable :: u_matrix(:,:,:),distance(:,:),cells_distances(:,:) integer,allocatable :: number_cluster_samples(:),index_cluster_samples(:,:) type(kohonen_layer_parameters),dimension(2) :: parameters type(factory_distance) :: factory class(distance_base),allocatable :: distance_function type(rkiss05_generator),dimension(2) :: rnumber_grator integer :: seed1,seed2 integer :: number_variables,number_variables1,number_variables2,number_clusters integer :: number_nodes contains procedure,public :: create => create_2lsom procedure,public :: destroy => destroy_2lsom procedure,private :: create_random_sample procedure,public :: train => train_2lsom procedure,public :: predict => predict_2lsom procedure,public :: train_grid_layer procedure,public :: train_cluster_layer procedure,public :: print => print_2lsom procedure,public :: query => query_2lsom procedure,public :: set_cluster_layer procedure,public :: set_parameters ! procedure,public :: read => read_som procedure,private :: query_2lsom procedure,public :: read_som_layer procedure,private :: calculate_u_matrix procedure,private :: find_best_match_unit procedure,private :: update_weights procedure,private :: calculate_distance_between_prototypes procedure,private :: assign_input_to_clusters !procedure,public :: get_count => get_count_2lsom !procedure,public :: get_index => get_index_som !procedure,public :: get_u_matrix => get_u_matrix_som procedure,public :: calculate_sum2_clusters_samples => evaluate_2lsom procedure,public :: get_cluster_samples procedure,public :: calculate_sum2_clusters_grid procedure,nopass,private :: calculate_distance_matrix procedure,nopass,private :: calculate_coordinates ! procedure,nopass,public :: external_train_map ! procedure,nopass,public :: external_predict_map !***** end type two_level_self_organizing_map