A good way of building neural networks in both Julia and Python

Hi,
I’ve built some custom neural networks in Julia (especially, Flux.jl).
However, for some reason, I wanna use the same neural networks in Python.

In this case, it may be possible to rewrite the neural networks code in Python,
but it is apparently time-consuming work, and
I have to modify codes twice every time when I decide to change some parts of networks.

Are there any good ideas to maintain a custom neural network code wisely?

There is PyCall.jl and pyjulia, but i guess you are looking for a transpiler, not just a way to call julia from python?

I dont know exactly what transpiler is but I didn’t mean to use Python codes in Julia :slight_smile:

You may want to take a look at PySR, which can be used from python but uses a Julia backend for the computation.

1 Like

The answer might be different for building and using neural networks, and also different than for non-NN code.

In general, you want to choose one language for your main language, for the heavy lifting. That could be Julia (historically C and/or C++ and Fortran). You can basically do everything, including neural networks in Julia only.

I’m not sure if these might be helpful: