Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bonsai-ai

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bonsai-ai

Simulator interface library for Bonsai AI platform v2

  • 2.2.8
  • PyPI
  • Socket score

Maintainers
2

Bonsai SDK

A python library for integrating data sources with Bonsai BRAIN.

Installation

To install the current release version: $ pip install bonsai-ai

Usage

Clients will subclass bonsai.Simulator and implement the required methods.

Example: ::

#!/usr/bin/env python3

import sys
from bonsai_ai import Simulator, Brain, Config

class MySim(Simulator):
    def episode_start(self, parameters):
        initial = {"value": 1.0}
        return initial

    def simulate(self, action, objective):
        terminal = True
        state = {"value": 1.0}
        return (state, 1.0, terminal)

Then, the simulator is configured and assigned a BRAIN and run. ::

def example():
    config = Config(sys.argv)
    brain = Brain(config)
    sim = MySim(brain, 'example_simulator')
    while sim.run():
        continue

Keywords

FAQs


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