Research Article

A Fortran-Keras Deep Learning Bridge for Scientific Computing

Algorithm 2

Forward pass in the FKB network module. Each layer simply calls its own forward function. The technical operations occur within each layer.
function output(self, input) result(last_layer_output)
  ...
  ! iterate through layers passing activation forward
  do n=1, size(layers)
   call layers(n) % p % forward(layers(n-1) % p % o)
end do
  ! get output from last layer
  last_layer_output=layers(size(layers)) % p % o
end function output