/deep-learn-tutorial

Primary LanguageJupyter NotebookMIT LicenseMIT

Project generated with PyScaffold

deep-learn-tutorial

Quick tutorial on deep learning for Introduction to Data Science

Two notebooks showing simple deep learning models;

  1. Regression

  2. Image classification

Installation

Note: deep learning environments are large, if you want to speed up your conda commands, you can use [mamba]. See Installation steps 1-4 of this repo

In order to set up the necessary environment:

  1. Download the repository by clicking the big green [code] button on the github page, and downloading the ZIP archive.

Note: Repositories act as distributed backups and make collaboration on programming projects more efficient, so learning to use git and github together is really useful in research.

  1. Unzip the archive to an easy-to-locate place

  2. Open the anaconda prompt

  3. Print your current directory to see where the prompt starts

    pwd
    
  4. Change the directory to your easy-to-locate-place

    cd easy-to-locate-place
    
  5. create a local environment stored in .env with the help of conda:

    conda config --set channel_priority strict
    
    conda env create -f environment.lock.yml -p ./.env
    

    Note: the following command assumes you left channel_priority as its default

    conda config --set channel_priority flexible
    
  6. activate the new environment with:

    conda activate ./.env
    
  7. run jupyter lab

    jupyter lab
    

Then take a look in the notebooks folders.

Dependency Management & Reproducibility

Note: I left this here for students to see how to properly utilize conda, but it is not necessary for the tutorial.

  1. Always keep your abstract (unpinned) dependencies updated in environment.yml and eventually in setup.cfg if you want to ship and install your package via pip later on.
  2. Create concrete dependencies as environment.lock.yml for the exact reproduction of your environment with:
    conda env export -p ./.env -f environment.lock.yml
    For multi-OS development, consider using --no-builds during the export.
  3. Update your current environment with respect to a new environment.lock.yml using:
    conda env update -p ./.env -f environment.lock.yml --prune

Project Organization

├── LICENSE.txt             <- License as chosen on the command-line.
├── README.md               <- The top-level README for developers.
├── configs                 <- Directory for configurations of model & application.
├── data
│   ├── external            <- Data from third party sources.
│   ├── interim             <- Intermediate data that has been transformed.
│   ├── processed           <- The final, canonical data sets for modeling.
│   └── raw                 <- The original, immutable data dump.
├── environment.yml         <- The conda environment file for reproducibility.
├── environment.lock.yml    <- The _pinned_ conda environment file for emergencies.
├── models                  <- Trained and serialized models, model predictions,
│                              or model summaries.
├── notebooks               <- Jupyter notebooks. Naming convention is a number (for
│                              ordering), the creator's initials and a description,
│                              e.g. `1.0-fw-initial-data-exploration`.
├── pyproject.toml          <- Build configuration. Don't change! Use `pip install -e .`
│                              to install for development.
├── references              <- Data dictionaries, manuals, and all other materials.
├── reports                 <- Generated analysis as HTML, PDF, LaTeX, etc.
│   └── figures             <- Generated plots and figures for reports.
├── setup.cfg               <- Declarative configuration of your project.
└── src
    └── deep_learn_tutorial <- Actual Python package where the main functionality goes.

Note

This project has been set up using PyScaffold 4.5 and the dsproject extension 0.7.2.