Created
December 16, 2025 16:03
-
-
Save keivalya/58f8ec4468034e5362692523349331bf to your computer and use it in GitHub Desktop.
Robot State Encoder.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Encoding robot state using a simple Multi-Layer Perceptron | |
| class StateEncoderMLP(nn.Module): | |
| def __init__(self, state_dim, d_model=128): | |
| super().__init__() | |
| self.net = nn.Sequential( | |
| nn.Linear(state_dim, 64), | |
| nn.ReLU(), | |
| nn.Linear(64, d_model), | |
| ) | |
| self.ln = nn.LayerNorm(d_model) | |
| def forward(self, s): | |
| x = self.net(s) | |
| x = self.ln(x) | |
| return x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment