lewfish / mlx

Machine learning experiments using PyTorch and fastai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mlx

Machine learning experiments using PyTorch and fastai

Build and run Docker image

./docker/build
./docker/run

To run Jupyter, use

./docker/run --jupyter

Feature Visualization

A notebook with a minimal example of doing feature visualization.

Camvid-Tiramisu Semantic Segmentation

This is a minimal example of a script for training a model using fastai/PyTorch with options to run a small test locally and then run it on a GPU using AWS Batch with data and results synced to S3. If the job is stopped in the middle of training, re-running it will resume training from a saved checkpoint. If you would like to force it to train from scratch you will need to delete the saved training results first. This takes about a minute to get to around 90% accuracy on a p3.2xlarge.

Prep

  • Build dataset zip file by cloning https://github.com/alexgkendall/SegNet-Tutorial.git and making a zip file containing just the CamVid subdirectory. Upload zip file to S3.
  • Setup Batch resources (job def, job queue, compute environment, ECR repo) using CloudFormation template in raster-vision-aws. This was intended for use with Raster Vision, but can be used to setup GPU resources more generally.
  • Adjust constants in ./scripts/publish_image and ./scripts/job_def.json
  • Run ./scripts/add_job_def. This is needed to add a special job def which maps /dev/shm which is needed to use multiprocessing and PyTorch on Batch.
  • Adjust URIs and hyperparams in mlx.semseg.camvid.

Run test locally

python -m mlx.semseg.camvid --test

Run on Batch

python -m mlx.semseg.camvid --batch

Object Detection

Work in progress on writing a single shot object detector.

  • Single box regression using Pascal 2007 notebook
  • Various utility functions for dealing with boxes can be tested using python -m mlx.od.test_utils

Credits

The code in mlx.filesystem was adapted from Raster Vision.

About

Machine learning experiments using PyTorch and fastai

License:Apache License 2.0


Languages

Language:Jupyter Notebook 98.3%Language:Python 1.7%Language:Shell 0.0%Language:Dockerfile 0.0%