Skip to content

uma-pi1/ml-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Setup for the Courses "Machine Learning" and "Deep Learning"

This is a docker environment with a Jupyter notebook for the assignments of the courses "Machine Learning (ML)" and "Deep Learning (DL)". This environment contains:

  • jupyter
  • numpy
  • pandas
  • graphviz
  • matplotlib
  • python-crfsuite
  • python-mnist
  • scikit-learn
  • scikit-optimize
  • scipy
  • torch
  • pystan

As of April 2024, this environment additionally contains:

  • Tensorboard
  • PyTorch Lightning
  • torchtext

Table of contents

  1. Installing Docker
  2. How to Setup
  3. How to Use

1. Install Docker

Before starting the local development environment, you need to install Docker.

Docker Installation - Windows

To use Docker on Windows install the Docker Desktop. We encourage you to use the WSL2 (Windows Subsystem for Linux) as backend. You can find the download link and corresponding installation instructions here.

https://docs.docker.com/desktop/install/windows-install/

Troubleshooting WSL

Docker in the WSL can use up too many resources. We therefore limit the RAM usage with the following commands.

Create the file

C:\Users\<username>\.wslconfig

with the following content

[wsl2]
memory=3GB

You can adapt the memory usage to your system. Furthermore, you can limit the amount of processors used by processors=1.

Starting the Docker Engine

On Windows you always need to start Docker first manually. Open Docker Desktop and click the little Docker icon in the bottom left corner to start the engine.

Docker Installation - Mac

To use Docker on Mac install the Docker Desktop. You can find the download link and corresponding installation instructions here.

https://docs.docker.com/desktop/install/mac-install/

Docker Installation - Linux

Installation using Snap

You can install docker using a single command on Ubuntu using Snap:

sudo snap install docker

Installation using apt-get

You can also install docker using apt-get. Please follow the official instuctions given here.

https://docs.docker.com/engine/install/ubuntu/

2. How to Setup

Clone this Repository

Clone this repository and go into the root directory of the repository by typing the following commands in a terminal:

git clone https://github.com/uma-pi1/ml-docker
cd ml-docker

Alternatively, you can click on the "Code" button on the top right of this page and click "Download ZIP". Then you need to decompress the ZIP file into a new folder.

Pull and Start the Docker Container

With an installed Docker environment and a started engine you can now run the Docker container by typing the following command in a terminal on the folder where you have this downloaded repository:

docker compose up

Note: The first time you are running this command it will take some time depending on your notebook and internet connection. It will only take that long the first time you run this command. All following start-ups should be quick.

You will need to run this command in this folder everytime you want to start up the jupyter notebook for these courses. The data you created/modified in the notebook the last time you used the notebook will be there the next time you start it.

3. How to Use

Run the following command in the root folder of the repository to get the notebook started:

docker compose up

You can access JupyterLab on

http://localhost:8888

If you see a prompt asking you for a token or password type ml.

7.1 Transfer Between Host and Notebook

All files placed in the folder ./shared located in the root directory of this repository on your host machine will directly appear in your jupyter lab environment. Vice versa, notebooks created in jupyter lab will directly be stored in the folder ./shared on your host machine.

7.2 Misc

The default user name in JupyterLab is jovyan.

""Jovyan is often a special term used to describe members of the Jupyter community. It is also used as the user ID in the Jupyter Docker stacks or referenced in conversations." For more information see here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published