Using Codex to translate Keras to fastai

Can OpenAI’s Codex “translate” Keras to fastai? This short article describes an experiment using Codex to automatically translate a simple Keras-based MNIST application into a fastai-based MNIST application: https://markryan-69718.medium.com/using-codex-to-translate-keras-to-fastai-8471a4596755?sk=7ac00ef3c300345f06bab9f44d4ba4d8

And here’s a video on the same topic: Codex translates between Keras and fastai - YouTube

5 Likes

Thanks for sharing. I was wondering if that was possible since Codex was announced. I wonder how accurate the reverse would be on a more complex problem; Fast.ai → Keras.

1 Like

Thanks @jquintanilla4 - for a simple MNIST model training app, Codex can go both directions: Keras → fastai and fastai → Keras. The article only describes one direction but the accompanying video Codex translates between Keras and fastai - YouTube shows both directions: Keras → fastai and fastai → Keras. The Keras that Codex produces did need one tweak (it was missing import of numpy), but otherwise it worked. I have not done experiments with more complex applications yet - it’s possible that Codex does well in both directions for MNIST models because there are several MNIST examples for Keras and fastai in github (a primary source of training data for Codex) that are readily identifiable.

1 Like