Set hyperparameters for 3D padding layer
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(pad3d_layer_type), | intent(inout) | :: | this |
Instance of the 3D padding layer |
||
| integer, | intent(in), | dimension(3) | :: | padding |
Padding sizes |
|
| character(len=*), | intent(in) | :: | method |
Padding method |
||
| integer, | intent(in), | optional | :: | verbose |
Verbosity level |
subroutine set_hyperparams_pad3d(this, padding, method, verbose) !! Set hyperparameters for 3D padding layer use coreutils, only: to_lower implicit none ! Arguments class(pad3d_layer_type), intent(inout) :: this !! Instance of the 3D padding layer integer, dimension(3), intent(in) :: padding !! Padding sizes character(*), intent(in) :: method !! Padding method integer, optional, intent(in) :: verbose !! Verbosity level this%name = "pad3d" this%type = "pad" this%input_rank = 4 this%output_rank = 4 this%pad = padding if(allocated(this%facets)) deallocate(this%facets) allocate(this%facets(this%input_rank - 1)) this%facets(1)%rank = 3 this%facets(1)%nfixed_dims = 1 this%facets(2)%rank = 3 this%facets(2)%nfixed_dims = 2 this%facets(3)%rank = 3 this%facets(3)%nfixed_dims = 3 select case(trim(adjustl(to_lower(method)))) case("valid", "none") this%imethod = 0 case("same", "zero", "constant", "const") this%imethod = 1 case("full") this%imethod = 2 case("circular", "circ") this%imethod = 3 case("reflection", "reflect", "refl") this%imethod = 4 case("replication", "replicate", "copy", "repl") this%imethod = 5 case default call stop_program("Unrecognised padding method :"//method) return end select this%method = trim(adjustl(to_lower(method))) end subroutine set_hyperparams_pad3d