Box refinement MLP (3 layers: D→D→D→4 with ReLU)
| 8182 | |
| 8183 | // Box refinement MLP (3 layers: D→D→D→4 with ReLU) |
| 8184 | static struct ggml_tensor* sam3_bbox_mlp(struct ggml_context* ctx, |
| 8185 | struct ggml_tensor* x, |
| 8186 | struct ggml_tensor* w[3], |
| 8187 | struct ggml_tensor* b[3]) { |
| 8188 | for (int j = 0; j < 3; ++j) { |
| 8189 | x = ggml_mul_mat(ctx, w[j], x); |
| 8190 | x = ggml_add(ctx, x, b[j]); |
| 8191 | if (j < 2) x = ggml_relu(ctx, x); |
| 8192 | } |
| 8193 | return x; |
| 8194 | } |
| 8195 | |
| 8196 | // Build sinusoidal positional embedding for 4D reference points in the ggml graph. |
| 8197 | // ref_boxes: [4, NQ, B] — (cx, cy, w, h) after sigmoid, B=1 |
nothing calls this directly
no outgoing calls
no test coverage detected