Code Monkey home page Code Monkey logo

batch-active-preference-based-learning's Introduction

This code learns reward functions from human preferences in various tasks by actively generating batches of scenarios and querying a human expert.

Companion code to CoRL 2018 paper:
E Bıyık, D Sadigh. "Batch Active Preference-Based Learning of Reward Functions". Conference on Robot Learning (CoRL), Zurich, Switzerland, Oct. 2018.

Dependencies

You need to have the following libraries with Python3:

Running

Throughout this demo,

  • [task_name] should be selected as one of the following: Driver, LunarLander, MountainCar, Swimmer, Tosser
  • [method] should be selected as one of the following: nonbatch, greedy, medoids, boundary_medoids, successive_elimination, random For the details and positive integer parameters K, N, M, b, B; we refer to the publication. You should run the codes in the following order:

Sampling the input space

This is the preprocessing step, so you need to run it only once (subsequent runs will overwrite for each task). It is not interactive and necessary only if you will use batch active preference-based learning. For non-batch version and random querying, you can skip this step.

You simply run

	python input_sampler.py [task_name] K

For quick (but highly suboptimal) results, we recommend K=1000. In the article, we used K=500000.

Learning preference reward function

This is where the actual algorithms work. You can simply run

	python run.py [task_name] [method] N M b

b is required only for batch active learning methods. We fixed B=20b. To change that simply go to demos.py and modify 11th line. Note: N must be divisible by b. After each query or batch, the user will be showed the w-vector learned up to that point. To understand what those values correspond to, one can check the 'Tasks' section of the publication.

Demonstration of learned parameters

This is just for demonstration purposes. run_optimizer.py starts with 3 parameter values. You can simply modify them to see optimized behavior for different tasks and different w-vectors.

batch-active-preference-based-learning's People

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.