Subroutine to generate random values that serve as inputs to the SOM
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(two_level_self_organizing_map) | :: | kohonen_map |
A |
|||
real(kind=wp), | intent(out), | dimension(:,:) | :: | input |
A real array with the initial values of the prototypes |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | nvar1 | ||||
integer, | public | :: | nvar2 | ||||
integer, | public | :: | i | ||||
integer, | public | :: | j |
subroutine create_random_sample(kohonen_map,input) !======================================================================================== !! Subroutine to generate random values that serve as inputs to the SOM class(two_level_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(1)%generate(); end do end do ! end subroutine create_random_sample