create_random_sample Subroutine

public subroutine create_random_sample(kohonen_map, input)

Subroutine to generate random values that serve as inputs to the SOM

Type Bound

self_organizing_map

Arguments

Type IntentOptional Attributes Name
class(self_organizing_map) :: kohonen_map

A self_organizing_map object

real(kind=wp), intent(out), dimension(:,:) :: input

A real array with the initial values of the prototypes


Calls

proc~~create_random_sample~~CallsGraph proc~create_random_sample self_organizing_map%create_random_sample none~generate rkiss05_generator%generate proc~create_random_sample->none~generate

Called by

proc~~create_random_sample~~CalledByGraph proc~create_random_sample self_organizing_map%create_random_sample proc~create_som self_organizing_map%create_som proc~create_som->proc~create_random_sample proc~external_predict_map self_organizing_map%external_predict_map proc~external_predict_map->proc~create_som proc~train_som train_som proc~train_som->proc~create_som

Variables

Type Visibility Attributes Name Initial
integer, public :: nvar1
integer, public :: nvar2
integer, public :: i
integer, public :: j

Source Code

    subroutine create_random_sample(kohonen_map,input)
!========================================================================================
!! Subroutine to generate random values that serve as inputs to the SOM
    class(self_organizing_map) :: kohonen_map
!! A `self_organizing_map` object
    real(kind=wp),dimension(:,:),intent(out) :: input 
!! A real array with the initial values of the prototypes
    integer :: nvar1,nvar2,i,j
!
    nvar1=size(input,1);
    nvar2=size(input,2);
    do i=1,nvar1;
        do j=1,nvar2;
            input(i,j)=kohonen_map%rnumber_grator%generate();
        end do
    end do
!    
    end subroutine create_random_sample