Skip to content

Add Mixture-of-Experts implementation #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jul 21, 2025
Merged

Add Mixture-of-Experts implementation #26

merged 6 commits into from
Jul 21, 2025

Conversation

Giulero
Copy link
Contributor

@Giulero Giulero commented Jul 17, 2025

This pull request introduces the implementation of Mixture of Experts (MoE) as actor.


New Features:

  • Introduction of Mixture-of-Experts Models:
    • Added ActorMoE class, which implements a Mixture-of-Experts actor model. This model combines outputs from multiple expert networks using a gating network and softmax weights. (amp_rsl_rl/networks/ac_moe.py, amp_rsl_rl/networks/ac_moe.pyR1-R170)
    • Added ActorCriticMoE class, which extends the ActorMoE with a critic network for actor-critic reinforcement learning. It includes support for noise modeling and action distribution. (amp_rsl_rl/networks/ac_moe.py, amp_rsl_rl/networks/ac_moe.pyR1-R170)

Codebase Updates:

  • Module Initialization Updates:
    • Updated __init__.py to include ActorMoE and ActorCriticMoE in the module's exports, ensuring they are accessible when importing the amp_rsl_rl/networks package. (amp_rsl_rl/networks/__init__.py, amp_rsl_rl/networks/init.pyR10-R13)

Copilot

This comment was marked as outdated.

@Giulero Giulero requested a review from Copilot July 17, 2025 15:30
Copilot

This comment was marked as outdated.

@Giulero Giulero requested a review from Copilot July 17, 2025 15:33
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces a Mixture-of-Experts (MoE) implementation for actor networks in reinforcement learning. The implementation provides both standalone actor MoE and actor-critic MoE classes that combine outputs from multiple expert networks using a gating mechanism.

  • Adds ActorMoE class implementing mixture-of-experts actor model with gating network
  • Adds ActorCriticMoE class extending ActorMoE with critic network for actor-critic RL
  • Updates module exports and ONNX exporter to support the new MoE architecture

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
amp_rsl_rl/networks/ac_moe.py New file containing MoE implementation with ActorMoE and ActorCriticMoE classes
amp_rsl_rl/networks/__init__.py Updates module exports to include new MoE classes
amp_rsl_rl/utils/exporter.py Adds ONNX export support for ActorMoE architecture
Comments suppressed due to low confidence (2)

amp_rsl_rl/networks/ac_moe.py:9

  • Class name 'MLP_net' violates Python naming conventions. It should be 'MLPNet' or 'MLP' following PascalCase convention for class names.
class MLP_net(nn.Sequential):

amp_rsl_rl/networks/ac_moe.py:108

  • Using the incorrectly named 'MLP_net' class. This should be updated once the class name is fixed to follow proper naming conventions.
        self.critic = MLP_net(num_critic_obs, critic_hidden_dims, 1, act)

@Giulero
Copy link
Contributor Author

Giulero commented Jul 21, 2025

Tested and working. Merging!

@Giulero Giulero merged commit 118a751 into main Jul 21, 2025
@Giulero Giulero deleted the mixture-of-experts branch July 21, 2025 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant