Git Product home page Git Product logo

fortran-gpt's Introduction

Learning Fortran by Teaching Fortran to Learn

This is my most recent project. It is intended to teach myself Fortran, with an eye on maybe running GPT on GPU in the future. I'm trying to follow Andrej Karpathy's tutorial while writing all required functionality as well. (There is even a merge-sort-implementation so I could implement random_choice reliably.)

Don't use. Not even close to production ready! Currently breaks valgrind. Even testing is homebrew!

Curernt state

The code compiles with gfortran network_utils.f08 network_layers.f08 structured_network.f08 file_helpers.f08 network_training.f08 -Wall without warnings. This will build an executable from the program block in network_training.f08, where several different scenarios are trained. First, a network to turn one-hot encoded numbers into binary is trained (and expected to fail). Then a perceptron is trained to approximate a simple parabola. Last, a network is trained on the content of "names.txt" to produce more names.

fortran-gpt's People

Watchers

 avatar

fortran-gpt's Issues

Use the .f90 file suffix instead of .f08

Please consider changing the source file suffixes from .f08 to .f90.
The .f90 suffix means that the source code is free format, not that
the code conforms to the Fortran 90 standard. Code that uses the .f90
suffix can use features from any Fortran standard. All Fortran
compilers recognize .f90 as a suffix indicating free source form, but
some may not recognize a suffix such as .f95, .f03, .f08, or .f18.
Some users may have build tools that do not recognize suffixes other
than .f90. Most Fortran source code on GitHub that uses features from
a standard more recent than Fortran 90 still uses the .f90 suffix.

gfortran compiled program fails with SIGABRT

When compiling with

the resulting file fails with the following output:

malloc(): invalid size (unsorted)

Program received signal SIGABRT: Process abort signal.

Backtrace for this error:
#0  0x7ab39fe23872 in ???
#1  0x7ab39fe22a05 in ???
#2  0x7ab39fc5fbaf in ???
#3  0x7ab39fcb0884 in ???
#4  0x7ab39fc5fafd in ???
#5  0x7ab39fc4887e in ???
#6  0x7ab39fc4960e in ???
#7  0x7ab39fcba7b4 in ???
#8  0x7ab39fcbda1b in ???
#9  0x7ab39fcbed71 in ???
#10  0x40cda7 in ???
#11  0x415128 in ???
#12  0x41a634 in ???
#13  0x7ab39fc49b89 in ???
#14  0x7ab39fc49c4a in ???
#15  0x401294 in ???
#16  0xffffffffffffffff in ???
Aborted (core dumped)

When using valgrind, it runs for longer, but eventually fails with:

valgrind: the 'impossible' happened:
   Killed by fatal signal

???????????

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.