Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

A Fortran-Keras Deep Learning Bridge for Scientific Computing

236 views
Skip to first unread message

Milan Curcic

unread,
Apr 23, 2020, 11:29:47 AM4/23/20
to
Hi CLF,

New paper and library from colleagues at UC Irvine and Chapman U.

Paper: https://arxiv.org/abs/2004.10652
Library: https://github.com/scientific-computing/FKB

Keras is the high-level API for Tensorflow, the most popular machine learning framework in the world. There are thus many many trained models available in Keras format. Fortran-Keras Bridge (FKB) allows using these models for prediction inside existing Fortran codebases, as well as to transfer updated models back from Fortran to Keras. The Fortran component of FKB extends the neural-fortran library, and allows implementing custom layers, in contrast to the original neural-fortan implementation which allowed only fully-connected layers.

The paper has been submitted to the Scientific Programming journal.

Cheers,
milan

FortranFan

unread,
Apr 24, 2020, 8:43:46 AM4/24/20
to
On Thursday, April 23, 2020 at 11:29:47 AM UTC-4, Milan Curcic wrote:

> Hi CLF,
>
> New paper and library from colleagues at UC Irvine and Chapman U.
>
> Paper: https://arxiv.org/abs/2004.10652
> Library: https://github.com/scientific-computing/FKB
>
> Keras is the high-level API for Tensorflow, the most popular machine learning framework in the world. There are thus many many trained models available in Keras format. Fortran-Keras Bridge (FKB) allows using these models for prediction inside existing Fortran codebases, as well as to transfer updated models back from Fortran to Keras. The Fortran component of FKB extends the neural-fortran library, and allows implementing custom layers, in contrast to the original neural-fortan implementation which allowed only fully-connected layers.
> ..

Very interesting, such developments are valuable for a Fortran "ecosystem". Thanks for sharing.

spectrum

unread,
May 8, 2020, 3:05:11 PM5/8/20
to
Thanks very much for sharing this library, which seems interesting
because of the extended functionality :)

# I've recently written a similar NN library in Python (to do some custom things)
and now trying to combine it with my Fortran codes... If the above library
is available, it may be useful for such cases (i.e. directly use it from the Fortran side).

By the way, the following line seems to define the derivative ("prime")
of the linear activation function (Line 103)

https://github.com/scientific-computing/FKB/blob/master/src/lib/mod_activation.F90#L103

but comparing this with Line 95,

https://github.com/scientific-computing/FKB/blob/master/src/lib/mod_activation.F90#L95

I'm wondering if it might be a typo of res = 1 ...?

(I am not sure because I haven't read the codes in detail,
but it looks like other functions have the
corresponding derivative in the "xxx_prime()" routines.)

# It might not appear as a "bug" if the linear one is not used
in practice (e.g., except for the final layer)...?

Milan Curcic

unread,
May 8, 2020, 5:35:23 PM5/8/20
to
> I'm wondering if it might be a typo of res = 1 ...?

I think you're right. I opened an issue here:

https://github.com/scientific-computing/FKB/issues/3

Cheers,
milan

spectrum

unread,
May 8, 2020, 6:10:48 PM5/8/20
to
On Saturday, May 9, 2020 at 6:35:23 AM UTC+9, Milan Curcic wrote:
> https://github.com/scientific-computing/FKB/issues/3

Thanks for filing the issue so quickly!
Best regards :)

PS. I wrote that "If the above library is available, it may be useful for ..." in my post,
and for clarity "the above library" means Fortran-Keras Bridge (rather than mine!)

Milan Curcic

unread,
May 8, 2020, 6:15:05 PM5/8/20
to
0 new messages