Fashion MNIST linear classification model with Keras 3.0 and PyTorch
Just install Python 3.11 - no GPU or specialized hardware required.
We recommend pyenv for creating and managing virtual environments.
Install project dependencies:
pip install -r requirements.txt
Set PyTorch as the backend for Keras (you may want to save this in your $HOME/.bashrc
as well):
export KERAS_BACKEND='torch'
Now train the model:
python main.py
Optionally save the model with --save-model
:
python main.py --save-model
Run the unit tests:
pytest -v
Adapted from Ch. 4.2-4.5 of D2L.ai for the latest and greatest Keras 3.0 framework with PyTorch as the backend