Composabl is a framework for building composable AI systems.
Project description
Composabl
Composabl helps you build Autonomous Agents! Through an easy SDK you get access to outscaled simulator training tools.
Getting Started
To get started and run your experiments, let's follow these steps
Prerequisites
- Python 3.8
- Composabl SDK (
pip install composabl
) - Acquire a License
Development
# Install the package as editable package
pip install -e .
Demo
python -m composabl.main
Training your first Agent
Save the below as main.py and run it with python main.py
from composabl.agent import Agent, Scenario, Skill
stabilize_scenarios = [
{
"angle": 0,
"horizontal_position": [-0.2, 0.2],
"vertical_position": [-0.5, -0.5],
"velocity": [-0.2, 0.2],
},
{
"angle": -.17,
"horizontal_position": [-0.5, 0.5],
"vertical_position": [-0.5, -0.25],
"velocity": 0
},
{
"angle": 0.12,
"horizontal_position": [-0.7, 0.7],
"vertical_position": [-.65, -0.1],
"velocity": 0
}
]
def stabilize_reward():
"""
if {{{prev_state}}} is None:
reward = 0
VIEWPORT_W = 600
VIEWPORT_H = 400
SCALE = 30.0
reward = 0
# has the angle moved closer to 0?
if abs({{prev_state[4]}}) >= abs({{state[4]}}) + 0.1 * 180 / math.pi:
reward += 1
# has the x position remained stable?
if abs({{prev_state[0]}} - {{state[0]}}) <= 0.01 * (VIEWPORT_W / SCALE / 2):
reward += 1
else:
reward -= 1
# has the y position remained stable?
if abs({{prev_state[1]}} - {{state[1]}}) <= 0.01 * (VIEWPORT_W / SCALE / 2):
reward += 1
else:
reward -= 1
"""
def main():
stabilize_skill = Actor(Skill, "stabilize", stabilize_reward(), trainable=True)
for scenario_dict in stabilize_scenarios:
scenario = Scenario(scenario_dict)
stabilize_skill.add_scenario(scenario)
agent = Agent({
"license": "<LICENSE_KEY>",
"env": {
"compute": "local", # "docker", "kubernetes", "local"
"config": {
"address": "localhost:1337",
# "image": "composabl.ai/sim-gymnasium:latest"
}
}
})
agent.add_skill(stabilize_skill)
agent.train(train_iters=5000)
if __name__ == "__main__":
main()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for composabl-0.0.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a41e1d487d25c3196834af8825570db53cb12c7dac4152e5a3d63ce8103c07c |
|
MD5 | 08fa48a482f634403ef2e8340656e967 |
|
BLAKE2b-256 | ee4c961e51716c07ebdca253b6af5e235fb24692de3c3bff6ff2d5145a1a33ac |
Close
Hashes for composabl-0.0.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ce0090ef5428e456a2d76348e91c5cfca1d47f2cb61130cc36614d6426ed0ba |
|
MD5 | 4994e6da1bdb2ab330b2c01ae520d020 |
|
BLAKE2b-256 | 082f71d23d733b5fc3f744aa4f8c9b2a1d091834ccbd0915583e7d72c24eec80 |
Close
Hashes for composabl-0.0.0-cp38-cp38-macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b72974c999bc4f9a4a0d12c93ca87a0f2374c360dafab2063a94a5f93e4936c |
|
MD5 | 9abdc1a29140d28485530b7e1a1f000e |
|
BLAKE2b-256 | e2a85472d93d4833ae85cbbbb32b0187241133914785dc8527443e9f98165396 |