Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alecokas/ml-framework-comparison
A super simple demonstration of how Flux.jl compares with Tensorflow 2 and Pytorch
https://github.com/alecokas/ml-framework-comparison
blog flux framework julia machine-learning mnist pytorch tensorflow tf2
Last synced: 4 days ago
JSON representation
A super simple demonstration of how Flux.jl compares with Tensorflow 2 and Pytorch
- Host: GitHub
- URL: https://github.com/alecokas/ml-framework-comparison
- Owner: alecokas
- License: mit
- Created: 2020-07-14T21:35:27.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-24T23:37:22.000Z (over 1 year ago)
- Last Synced: 2024-10-31T02:03:46.487Z (about 2 months ago)
- Topics: blog, flux, framework, julia, machine-learning, mnist, pytorch, tensorflow, tf2
- Language: Julia
- Homepage: https://alecokas.github.io/julia/flux/2020/07/20/flux-flexible-ml-for-julia.html
- Size: 30.3 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A Machine Learning Framework Comparison
This repository is the companion code to my blog post [**Flux: The Flexible Machine Learning Framework for Julia**](https://alecokas.github.io/julia/flux/2020/07/20/flux-flexible-ml-for-julia.html), where I discuss using Flux as a framework for machine learning in Julia. This takes the form of presenting side-by-side comparisons between the Keras Functional API, PyTorch, and two Flux implementations. See the `src` directory for the full scripts.
## Training
The four scripts can be run as follows:
#### Functional Flux
Add all packages in the `julia-env/Project.toml` file.
```
julia --project=julia-env src/flux_functional_mnist.jl
```
#### Modular Flux
Add all packages in the `julia-env/Project.toml` file.
```
julia --project=julia-env src/flux_modular_mnist.jl
```
#### Tensorflow 2
```
$ python3 -m venv ../tf2env
$ source activate ../tf2env/bin/activate
$ pip install -r tf2-requirements.txt
$ python src/tf2_mnist.py
```
#### PyTorch
```
$ python3 -m venv ../ptenv
$ source activate ../ptenv/bin/activate
$ pip install -r pt-requirements.txt
$ python src/pt_mnist.py
```