Coder Social home page Coder Social logo

v1ta111 / webppl-agents-satisfia Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pik-gane/webppl-agents-satisfia

0.0 0.0 0.0 2.7 MB

Webppl library for generating Gridworld MDPs. JS library for displaying Gridworld. Additional agents that satisfice.

JavaScript 87.46% Python 0.49% Jupyter Notebook 12.05%

webppl-agents-satisfia's Introduction

webppl-agents-satisfia

Extension of webppl-agents with additional non-maximizing agent types

To test:

webppl --require webppl-dp --require . examples/runVerySimpleGW.wppl -- --gw GW3 --verbose

(original README.md:)

webppl-agents

This package provides constructors for MDP and POMDP agents, for gridworld and bandit environments, and a function for visualizing gridworlds:

Installation

To globally install webppl-agents, run:

mkdir -p ~/.webppl
npm install --prefix ~/.webppl webppl-agents

This may print warnings (npm WARN ENOENT...) which can be ignored.

To upgrade to the latest version, run:

npm install --prefix ~/.webppl webppl-agents --force

For the agent functions, you will also need to install webppl-dp.

Usage

Once installed, you can make the environment and agent functions available to program.wppl by running:

webppl --require webppl-dp --require webppl-agents program.wppl

Testing

Run the included test using:

webppl --require webppl-dp --require . tests/tests.wppl

License

MIT

Additions in this fork:

We added a non-maximizing agent based on aspiration levels: makeMDPAgentSatisfia. Rather than maximizing the return, this agent is given an initial aspiration point or interval aleph0 and uses a policy that produce a return (here called total) whose expectation equals this point or falls into this interval, if that is possible. To achieve this, the agent propagates the initial aspiration from step to step, taking into account the reward (here called delta) it gets and the possible total that is still achievable from the current state. It does so in such a way that the total equals the initial aspiration in expectation, using what we call "aspiration rescaling".

Since there are in general many possible policies that fulfil the constraint regarding the expected total, the agent will use a number of additional criteria to determine its actions. In each timestep, it will use a mix of actions that can satisfy the aspiration in expectation, selected on the basis of a loss function mixed from, amongst others, the following terms using adjustable loss coefficients:

  • variance of resulting total
  • squared deviation of the local relative aspiration (the relative position of an action's Q-value in the feasible interval) of each step from 0.5
  • "messing potential" (maximal trajectory entropy that one may produce from the successor state when taking a certain action)
  • behavioral entropy of the policy
  • deviation from a reference policy (KL divergence)
  • "power" as measured by the squared width of the interval of feasible totals
  • other user-supplied safety loss terms
  • random noise

webppl-agents-satisfia's People

Contributors

owainevans avatar dfilan avatar mensch72 avatar jsalvatier avatar stuhlmueller avatar daneufeld97 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.