LESSON 50 OF 52 · CHAPTER 06
Linear Transform
matmul composition of a 2×3 and a 3×2 tile
09-linear-transform.srp
// Composition of rectangular linear transformations.
bind left = tile([1.0, 2.0, 3.0, 4.0, 5.0, 6.0], 2, 3);
bind right = tile([7.0, 8.0, 9.0, 10.0, 11.0, 12.0], 3, 2);
print(matmul(left, right));
stdout
tile(2x2)[[58.0, 64.0], [139.0, 154.0]]
Write what you expect this program to print. Check prediction for a line-level hint without revealing the answer, or reveal the verified output when ready. This checks displayed text only; it does not run Scarp or save your input.
UNDERSTAND THE CODE
Explanation & practice
What this example teaches
matmul composition of a 2×3 and a 3×2 tile
Expected behavior
tile(2x2)[[58.0, 64.0], [139.0, 154.0]]
Practice: Read the source before looking at the output. Predict the values and their order, then use the pinned compiler to execute this lesson and compare the exact fixture. Identify which operation produces the result.
आयताकार मैट्रिक्स का गुणन
matmul(left, right) दो tile मैट्रिक्स का संयोजन करता है। 2×3 और 3×2 मैट्रिक्स से 2×2 परिणाम मिलता है। पहली पंक्ति की पहली संख्या के लिए 1×7 + 2×9 + 3×11 = 58। यह मैट्रिक्स सुविधा है, कोई पूर्ण वैज्ञानिक कम्प्यूटिंग प्रणाली नहीं।
आउटपुट: tile(2x2)[[58.0, 64.0], [139.0, 154.0]]।
अभ्यास: परिणाम में दो पंक्तियाँ और दो स्तंभ क्यों आते हैं?
Explanations are sourced from the project's English chapter guide and हिन्दी अध्याय. The Scarp program and output are unchanged.
LEARNING PROGRESS
Keep your place
Mark this lesson complete when you are ready.
Only saved in this browser. No account or tracking.
TRY IT LOCALLY
Verify, then execute
Use the pinned compiler from the course root. Keep any imported _support files next to the source.
scarp verify examples/06-ai-foundations/09-linear-transform.srp
scarp exec examples/06-ai-foundations/09-linear-transform.srpThe website does not run code. Read the CLI guide ↗
Pinned compiler: Scarp v0.0.6-alpha.3
· ceff07d9014f. No simulated output.