
This is a repeating article in Fortran Forum. The first version appeared in Fortran Forum in April 2007. It has been revised on a regular basis since.
This version has been updated with details of the Intel 19.1 release and the Nag 7.0 release.
Generic programming holds the promise of reducing the amount of code that needs to be written and maintained: rather than copying source code and adapting it for a new data type you simply let the compiler do that tedious job. Templates as featured in C++ are an exemple par excellence of generic programming. From the point of view of the programmer/user they are very easy to use:
This paper describes neural-fortran, a parallel Fortran framework for neural networks and deep learning. It features a simple interface to construct feed-forward neural networks of arbitrary structure and size, several activation functions, and stochastic gradient descent as the default optimization algorithm. Neural-fortran also leverages the Fortran 2018 standard collective subroutines to achieve data-based parallelism on shared- or distributed-memory machines. First, I describe the implementation of neural networks with Fortran derived types, whole-array arithmetic, and collective sum and broadcast operations to achieve parallelism. Second, I demonstrate the use of neural-fortran in an example of recognizing hand-written digits from images. Finally, I evaluate the computational performance in both serial and parallel modes. Ease of use and computational performance are similar to an existing popular machine learning framework, making neural-fortran a viable candidate for further development and use in production.
This is a repeating article in Fortran Forum. The first version appeared in Fortran Forum in April 2007. It has been revised on a regular basis since. The 25th revision has updated all references to WG5 documents which used to reside on an ftp server at Nag (https://www.nag.co.uk/) to point to the new server maintained by Steve Lionel, the current WG5 convenor. The home address for WG5 is: https://wg5-fortran.org/