extract_output_real Module Subroutine

module subroutine extract_output_real(this, output)

Get the output of the network as real array

Arguments

Type IntentOptional Attributes Name
class(network_type), intent(in) :: this
real(kind=real32), intent(out), dimension(..), allocatable :: output

Output


Source Code

  module subroutine extract_output_real(this, output)
    !! Get the output of the network as real array
    implicit none

    ! Arguments
    class(network_type), intent(in) :: this
    ! Instance of network
    real(real32), dimension(..), allocatable, intent(out) :: output
    !! Output

    ! Local variables
    integer :: layer_id
    !! Layer ID
    character(len=10) :: rank_str
    !! String for rank

    ! check if number of leaf vertices is 1
    if(size(this%leaf_vertices,1).gt.1)then
       call print_warning("Output extraction to real array only works for single &
            &output networks")
       return
    end if

    ! Get output from the first (and only) leaf vertex
    layer_id = this%auto_graph%vertex(this%leaf_vertices(1))%id
    call this%model(layer_id)%layer%output(1,1)%extract(output)

  end subroutine extract_output_real