Skip to content

Commit e027b13

Browse files
committed
Begin work on the Keras adapter module
1 parent 48889c5 commit e027b13

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/nf/nf_keras.f90

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module nf_keras
2+
3+
!! This module provides procedures to read and parse Keras models
4+
!! from HDF5 files.
5+
6+
implicit none
7+
8+
private
9+
public :: get_keras_h5_layers
10+
11+
type :: keras_layer
12+
!! Intermediate container to convey the Keras layer information
13+
!! to neural-fortran layer constructors.
14+
character(:), allocatable :: type
15+
character(:), allocatable :: name
16+
character(:), allocatable :: activation
17+
integer, allocatable :: num_elements(:)
18+
end type keras_layer
19+
20+
interface
21+
22+
module function get_keras_h5_layers(filename) result(res)
23+
character(*), intent(in) :: filename
24+
!! HDF5 file name
25+
type(keras_layer), allocatable :: res(:)
26+
end function get_keras_h5_layers
27+
28+
end interface
29+
30+
end module nf_keras

0 commit comments

Comments
 (0)