Coder Social home page Coder Social logo

master-thesis's Introduction

Master's Thesis

Code style: black

Requirements

  • Python 3.8
  • Poetry 1.1
  • graphviz (optional)
  • manim (optional)

Setup (tested on MacOS and Windows)

  1. Download & install the latest python 3.8 release from here

  2. Download and install poetry as explained here

  3. Optional: Install graphviz

    Mac:
    brew install graphviz
    
    Windows:
    choco install graphviz
    

4.1. Optional: Install manim dependencies as described here

4.2. Optional: Run poetry add manimce==0.1 to add manim to poetry

  1. Run poetry install in the root of the repository to create a virtual environment and install the required dependencies

  2. Run one of the run scripts ...

    6.1. ... using the command line

    poetry shell
    
    poetry run python rl/main_dataset.py
    poetry run python rl/main.py
    poetry run python supervised/main.py
    

    6.2. ... through an IDE:

    • Select the poetry venv as interpreter & run one of the run scripts

Graphviz

If Graphviz is installed, the architecture images can be generated by using the save_model_architecture_images() method that is implemented in Network and its inheriting classes (e.g. NetworkRL and NetworkSupervised)

Manim

Manim is required to use the RLScene class script in animation/network_scene. If it is set up, a video file can be generated by running

manim animation/network_scene.py RLScene -p -qp

More information about manim can be found here

RLScene

  • animates the training process of the Reinforcement Learner
  • not designed to be too generic
    • might need adjustments when changing parameters

Black

Black is used to ensure a consistent code style. Additionally, a pre-commit hook is configured and can be activated by running pre-commit install

If it is activated, the code is analyzed during a commit. If adjustments are necessary, the following happens:

  • the commit fails
  • the code gets automatically adjusted according to the Black style guide

The changes then need to be re-added and committed again.

Troubleshooting

This section lists problems encountered during the work and the required steps to resolve them

SSL Certificate issue

Occurred on macOS. Can be fixed when running the following command to install necessary certificates:

/Applications/Python 3.8/Install Certificates.command

Good to know

  1. All run scripts are designed to be invoked from the root directory! (e.g. running main_dataset.py from within the rl folder does not work)

  2. The main scripts in the experiment branches were invoked via PyCharm and likely fail to run when invoked from the command line because the repository root folder is not in the pythonpath. This can be addressed by adding the following lines on top of the run scripts.

    import sys
    import os
    sys.path.insert(0, os.getcwd())

    Those lines are already included for all run scripts on the master branch.

master-thesis's People

Contributors

christiancoenen avatar

Watchers

 avatar

Forkers

lucaschilling

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.