Repository navigation
Dev/transformer #9
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
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c03cc0d
feat(test): add synthetic policy generation and tests
ZGZ713912 a12f942
test(ActionChannel): add test for concurrent snapshot handling
ZGZ713912 e69747f
docs(README): update model information and requirements
ZGZ713912 79851ce
feat: support multiple model types and input shapes
ZGZ713912 cdabd56
feat(policy): add support for extra input constants
ZGZ713912 7d7823d
feat: add support for typed extra inputs and layout validation
ZGZ713912 77e7db1
feat: allow unstamped policy deployment
ZGZ713912 f98953f
feat(models): add new model files and remove obsolete ones
ZGZ713912 f7bd161
feat(action_feedback): implement action feedback history
ZGZ713912 25d34da
Merge remote-tracking branch 'origin/main' into dev/transformer
ZGZ713912 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| #pragma once | ||
|
|
||
| #include <algorithm> | ||
| #include <chrono> | ||
| #include <cstddef> | ||
| #include <deque> | ||
| #include <span> | ||
| #include <stdexcept> | ||
| #include <vector> | ||
|
|
||
| namespace rmcs_rl { | ||
|
|
||
| // Prior-action features retain their training delay when inference is faster. | ||
| class ActionFeedbackHistory { | ||
| public: | ||
| using Clock = std::chrono::steady_clock; | ||
| explicit ActionFeedbackHistory(std::size_t size) : values_(size, 0.0) {} | ||
|
|
||
| void store(Clock::time_point observation_time, std::span<const double> action) { | ||
| if (action.size() != values_.size()) | ||
| throw std::invalid_argument("action feedback size mismatch"); | ||
| if (!samples_.empty() && observation_time <= samples_.back().time) | ||
| return; | ||
| samples_.push_back({observation_time, std::vector<double>{action.begin(), action.end()}}); | ||
| } | ||
|
|
||
| const std::vector<double>& sample(Clock::time_point now, std::chrono::nanoseconds delay) { | ||
| const auto target = now - delay; | ||
| while (samples_.size() > 1 && samples_[1].time <= target) | ||
| samples_.pop_front(); | ||
| if (!samples_.empty() && samples_.front().time <= target) | ||
| values_ = samples_.front().action; | ||
| return values_; | ||
| } | ||
|
|
||
| void reset() { | ||
| samples_.clear(); | ||
| std::fill(values_.begin(), values_.end(), 0.0); | ||
| } | ||
|
|
||
| private: | ||
| struct Sample { | ||
| Clock::time_point time; | ||
| std::vector<double> action; | ||
| }; | ||
| std::deque<Sample> samples_; | ||
| std::vector<double> values_; | ||
| }; | ||
|
|
||
| } // namespace rmcs_rl |
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
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
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
修正 README 中辅助维度"缺失即拒绝"的描述。
第 83-84 行写明
rmcs_history_length、rmcs_obs_frame_size和sequence_length"缺失或不一致都会拒绝"。代码只拒绝"不一致"的情况,不拒绝"缺失"的情况:src/policy/onnx_runtime.cpp的parse_positive在 metadata 缺失时返回 0。rmcs_obs_layout,序列维度就回退到layout->history。test/runtime_test.cpp的LoadsSequenceUsingRequiredLayoutOnly也断言缺少这些键时模型可以正常加载。按当前文档,操作者会以为漏写这些键时启动会失败。实际上启动会成功。
📝 文档修正
📝 Committable suggestion
🤖 Prompt for AI Agents