Giter Site home page Giter Site logo

perrohunter / distracted-drivers-keras Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fomorians/distracted-drivers-keras

0.0 2.0 0.0 22 KB

Starter project for the Kaggle State Farm Distracted Driver Detection Competition

Home Page: https://fomoro.com/

Python 100.00%

distracted-drivers-keras's Introduction

Distracted Drivers Starter Project

This starter project currently ranks in the top 15% of submissions and with a few minor changes can reach the top 10%.

Follow the Fomoro cloud setup instructions to get started with AWS spot instances without the hassle of setting up infrastructure. Fomoro provisions GPU instances, tracks model and dataset versions, and allows you to focus on iteration.

Training

Before using this code you must agree to the Kaggle competition's terms of use.

Setup

Feel free to email me or reach out on Twitter if you need help getting started.

  1. Follow the installation guide for Fomoro.
  2. Fork this repo.
  3. Clone the forked repo.

Dataset Preparation

In this step we'll upload the dataset to Fomoro for training.

  1. Download the images and drivers list into the "dataset" folder:
  2. Unzip both into the "dataset" folder so it looks like this:
  • distracted-drivers-keras/
    • dataset/
      • imgs/
        • train/
        • test/
      • driver_imgs_list.csv
  1. From inside the dataset folder, run python prep_dataset.py. This generates a pickled dataset of numpy arrays.
  2. Again, from inside the dataset folder, run fomoro data publish. This will upload the dataset to Fomoro for training.

Model Training

  1. Copy the clone url from your fork on Github:

HTTPS Clone URL

  1. Insert the clone url into the "repo" line of the fomoro.toml config in the root of the repo.
  2. Insert your Fomoro username as described in the fomoro.toml config.
  3. Add the model to Fomoro: fomoro model add.
  4. Start a training session: fomoro session start -f. Training should take a little over 30 minutes.

Making Changes

When you want to train new code, simply commit the changes, push them to Github, then run fomoro session start -f.

You can type fomoro help for more commands.

Running Locally

To run the code locally simply install the dependencies and run python main.py.

Model Development

  1. Tune your learning rate. If the loss diverges, the learning rate is probably too high. If it never learns, it might be too low.
  2. Good initialization is important. The initial values of weights can have a significant impact on learning. In general, you want the weights initialized based on the input and/or output dimensions to the layer (see Glorot or He initialization).
  3. Early stopping can help prevent overfitting but good regularization is also beneficial. L1 and L2 can be hard to tune but batch normalization and dropout are usually much easier to work with.

distracted-drivers-keras's People

Contributors

jimfleming avatar

Watchers

perrohunter avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.