Skip to main content

Streaming Deep Reinforcement Learning

Project description

Streaming Deep RL

Explorations into the proposed Streaming Deep Reinforcement Learning, from University of Alberta.

Once completed, if it checks out, will reach to integrate the Stream Q(λ) with Q-Transformer.

A recent testimony to Streaming AC(λ) variant can be found here. Will be incorporated into the repository as well with a few improvements.

Paper reading by Youtube AI/ML educator @hu-po.

The official repository can be found here.

Install

$ pip install streaming-deep-rl

Usage

import torch

from streaming_deep_rl import StreamingACLambda
from x_mlps_pytorch.normed_mlp import MLP

# actor and critic

actor = MLP(
    8, 128, 128, 128,
    norm_elementwise_affine = False,
    activate_last = True
)

critic = MLP(
    8, 128, 128,
    norm_elementwise_affine = False
)

# agent

agent = StreamingACLambda(
    actor = actor,
    critic = critic,
    dim_state = 8,
    dim_actor = 128,
    num_discrete_actions = 4,
    delay_steps = 7 # 7-step TD works well for me. next step TD tends to hit a performance wall
)

# get action from state and pass to environment or world model

state = torch.randn(8)
action, action_dist = agent(state, sample = True)

# environment or world model gives back

next_state = torch.randn(8)
reward = torch.tensor(1.)
done = torch.tensor(False)

# update at each timestep, "streaming"

agent.update(
    state = state,
    action = action,
    next_state = next_state,
    reward = reward,
    is_terminal = done
)

Lunar Lander

$ uv run train_lunar.py

Citations

@inproceedings{Elsayed2024StreamingDR,
    title   = {Streaming Deep Reinforcement Learning Finally Works},
    author  = {Mohamed Elsayed and Gautham Vasan and A. Rupam Mahmood},
    year    = {2024},
    url     = {https://api.semanticscholar.org/CorpusID:273482696}
}
@article{Nauman2024BiggerRO,
    title   = {Bigger, Regularized, Optimistic: scaling for compute and sample-efficient continuous control},
    author  = {Michal Nauman and Mateusz Ostaszewski and Krzysztof Jankowski and Piotr Milo's and Marek Cygan},
    journal = {ArXiv},
    year    = {2024},
    volume  = {abs/2405.16158},
    url     = {https://api.semanticscholar.org/CorpusID:270063045}
}
@misc{daley2025averagingnstepreturnsreduces,
    title   = {Averaging $n$-step Returns Reduces Variance in Reinforcement Learning}, 
    author  = {Brett Daley and Martha White and Marlos C. Machado},
    year    = {2025},
    eprint  = {2402.03903},
    archivePrefix = {arXiv},
    primaryClass = {cs.LG},
    url     = {https://arxiv.org/abs/2402.03903}, 
}
@misc{chen2026cautiousweightdecay,
    title   = {Cautious Weight Decay}, 
    author  = {Lizhang Chen and Jonathan Li and Kaizhao Liang and Baiyu Su and Cong Xie and Nuo Wang Pierse and Chen Liang and Ni Lao and Qiang Liu},
    year    = {2026},
    eprint  = {2510.12402},
    archivePrefix = {arXiv},
    primaryClass = {cs.LG},
    url     = {https://arxiv.org/abs/2510.12402}, 
}
@misc{kumar2024maintainingplasticitycontinuallearning,
    title   = {Maintaining Plasticity in Continual Learning via Regenerative Regularization}, 
    author  = {Saurabh Kumar and Henrik Marklund and Benjamin Van Roy},
    year    = {2024},
    eprint  = {2308.11958},
    archivePrefix = {arXiv},
    primaryClass = {cs.LG},
    url     = {https://arxiv.org/abs/2308.11958}, 
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

streaming_deep_rl-0.1.18.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

streaming_deep_rl-0.1.18-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file streaming_deep_rl-0.1.18.tar.gz.

File metadata

  • Download URL: streaming_deep_rl-0.1.18.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for streaming_deep_rl-0.1.18.tar.gz
Algorithm Hash digest
SHA256 6e2dee1900733d59e18adac7f7e103959bd35edd296aca132c83a7175bf3d115
MD5 75382f78937b336062c356324c39094e
BLAKE2b-256 c037ba72c01aba74941367f2ed5a4837dd374b698343ea9629b32827ad095937

See more details on using hashes here.

File details

Details for the file streaming_deep_rl-0.1.18-py3-none-any.whl.

File metadata

File hashes

Hashes for streaming_deep_rl-0.1.18-py3-none-any.whl
Algorithm Hash digest
SHA256 8bd60645571f82bbe98ae730eef6b779e512b61ea53c880588de84b76aba9b02
MD5 dcc7f6e55cad2e2b73ec02b657a381b5
BLAKE2b-256 8850c3ef000d13360503f3e9e0b3a303f23a885487cf5b98f78667b7a0faba0b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page