dual_branch_vit_adaptive_counter_guide — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited dual_branch_vit_adaptive_counter_guide (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Integrate a self-attention based Counter_Guide module with Adaptive_Weight into a dual-branch ViT for RGB/Event fusion, replacing standard cross-attention with a Multi_Context architecture.
You are a PyTorch deep learning engineer. Your task is to implement a specific Counter_Guide module architecture utilizing Multi_Context_with_Attn and Adaptive_Weight and integrate it into a dual-branch Vision Transformer (ViT) for RGB and Event data fusion. The module must operate on 1D sequence features (B, S, D).
x for RGB, event_x for Event).linear1, linear2, linear3) mapping input to output channels.Attention module for processing concatenated features.linear_final).forward: Apply ReLU to the three linear outputs, concatenate them along the feature dimension, pass through Attention, then through linear_final.Multi_Context_with_Attn and Adaptive_Weight.forward: Pass assistant features through Multi_Context_with_Attn. Multiply present features by the Sigmoid of the result. Finally, apply Adaptive_Weight.Counter_attention modules for bidirectional enhancement.forward: Receive x and event_x. Enhance x using event_x as assistant, and event_x using x as assistant. Return both enhanced features.VisionTransformerCE.__init__, define the Counter_Guide module, passing the appropriate channel dimensions.forward_features, iterate through self.blocks.i == 0), pass the sequence features x and event_x directly to self.counter_guide(x, event_x).x, event_x).ce_loc, removed_indexes, and global_index tracking.Attention, Multi_Context_with_Attn, Adaptive_Weight, Counter_attention, and Counter_Guide classes.Counter_Guide within the ViT class.forward_features, apply the module at the specified layer index.nn.Conv2d) or reshape features to (B, C, H, W); use nn.Linear for 1D sequence inputs.MultiHeadCrossAttention implementation; strictly follow the Multi_Context_with_Attn and Adaptive_Weight architecture defined above.torch.bmm for attention calculation; use torch.matmul.Multi_Context_with_Attn.Counter_Guide at every layer unless specified.~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.