The Pattern Weaver's Code

Representation Learning, Advanced Theory & Miscellaneous DS practice problem on Onlearn.

Difficulty: medium.

Topics: The Pattern Weaver's Code, Disentangled Representations, Persistent Homology, Kullback-Leibler Divergence, Kernel Principal Component Analysis, Evidence Lower Bound, Representation Learning, Information Theory, Manifold Learning, Probabilistic Graphical Models, Computational Topology, Latent Variable Modeling, Dimensionality Reduction, Entropy Estimation, Topological Data Analysis, Variational Inference.

Deep in the Crystal Cave, the enigmatic Pattern Weaver creates stunning sequences by uncovering the intricate relationships between crystals. Each crystal is marked by a unique numeric value, and the Weaver emphasizes that the true power of any crystal depends on how it interacts with all others. You have discovered N crystals, each with a specific value, and your task is to reveal their enhanced patterns by analyzing these relationships using self attention. Given a sequence of crystals and their values, your task is to implement a simplified self attention mechanism. For each crystal, calculate its relationship with every other crystal, compute the attention scores using the softmax function, and derive the final weighted pattern for each crystal. This Problem was made with the help of GroundZero AI