New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

qlearning

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qlearning

An implementation of a qlearning algorithm for node environments

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Q-Learning in node.js

Build Status TypeScript


DISCLAIMER: This library is still a WORK IN PROGRESS and is currently INCOMPLETE use at your own risk

Interested in doing reinforcement learning in node.js? Me too.

This is an experimental library to provide an interface for working with Q-Learning inside your node application.

import QL from 'qlearning'

const initialState = {x: 0, y: 0}
const learningRate = 0.35
const actions = ['forward', 'backwards', 'left', 'right']

const agent = new QL('name', actions, learningRate)

// What is the cost of moving to the specified `state` and taking `action`
agent.setCost((state, action) => {})
// What is the reward for `state`
agent.setReward((state) => {})
// Generate the next state given `state` and taking `action`
agent.setStateGenerator((state, action) => {})

// Let's get going!
agent.start(initialState)

This is essentially a rewrite of the open-source library q-exp by starcolon but to be more comprehensible (imo)

FAQs

Package last updated on 05 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc